diff --git a/sdk/compose/foundation/src/commonMain/kotlin/io/github/composegears/valkyrie/sdk/compose/foundation/animation/RememberShimmer.kt b/sdk/compose/foundation/src/commonMain/kotlin/io/github/composegears/valkyrie/sdk/compose/foundation/animation/RememberShimmer.kt index d33138616..29792d168 100644 --- a/sdk/compose/foundation/src/commonMain/kotlin/io/github/composegears/valkyrie/sdk/compose/foundation/animation/RememberShimmer.kt +++ b/sdk/compose/foundation/src/commonMain/kotlin/io/github/composegears/valkyrie/sdk/compose/foundation/animation/RememberShimmer.kt @@ -7,7 +7,9 @@ import androidx.compose.animation.core.infiniteRepeatable import androidx.compose.animation.core.rememberInfiniteTransition import androidx.compose.animation.core.tween import androidx.compose.runtime.Composable +import androidx.compose.runtime.Stable import androidx.compose.runtime.State +import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.draw.drawWithContent import androidx.compose.ui.geometry.CornerRadius @@ -18,6 +20,7 @@ import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp /** Container holding shared shimmer animation state. */ +@Stable class Shimmer internal constructor( internal val translateState: State, internal val gradientWidthFactor: Float, @@ -46,7 +49,9 @@ fun rememberShimmer( ), label = "RememberShimmerTranslate", ) - return Shimmer(translateState, gradientWidthFactor) + return remember(gradientWidthFactor) { + Shimmer(translateState, gradientWidthFactor) + } } /** Apply a remembered shimmer to this modifier. */ diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/service/PersistentSettings.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/service/PersistentSettings.kt index eb9fa00b9..d7c2d73da 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/service/PersistentSettings.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/service/PersistentSettings.kt @@ -10,11 +10,11 @@ import io.github.composegears.valkyrie.jewel.tooling.GlobalPreviewState import io.github.composegears.valkyrie.sdk.shared.ValkyrieMode import io.github.composegears.valkyrie.service.PersistentSettings.ValkyrieState import io.github.composegears.valkyrie.ui.domain.model.PreviewType -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings.Companion.DEFAULT_FILL -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings.Companion.DEFAULT_GRADE -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings.Companion.DEFAULT_OPTICAL_SIZE -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings.Companion.DEFAULT_WEIGHT -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings.Companion.DEFAULT_SIZE +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings.Companion.DEFAULT_SIZE +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialFontSettings.Companion.DEFAULT_FILL +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialFontSettings.Companion.DEFAULT_GRADE +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialFontSettings.Companion.DEFAULT_OPTICAL_SIZE +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialFontSettings.Companion.DEFAULT_WEIGHT @State(name = "Valkyrie.Settings", storages = [Storage("valkyrie_settings.xml")]) class PersistentSettings : SimplePersistentStateComponent(ValkyrieState()) { diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/settings/InMemorySettings.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/settings/InMemorySettings.kt index 7297f4f2e..e1b2ff47c 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/settings/InMemorySettings.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/settings/InMemorySettings.kt @@ -9,11 +9,11 @@ import io.github.composegears.valkyrie.service.PersistentSettings.Companion.pers import io.github.composegears.valkyrie.ui.domain.model.PreviewType import io.github.composegears.valkyrie.ui.extension.or import io.github.composegears.valkyrie.ui.extension.updateState -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings.Companion.DEFAULT_FILL -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings.Companion.DEFAULT_GRADE -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings.Companion.DEFAULT_OPTICAL_SIZE -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings.Companion.DEFAULT_WEIGHT -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings.Companion.DEFAULT_SIZE +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings.Companion.DEFAULT_SIZE +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialFontSettings.Companion.DEFAULT_FILL +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialFontSettings.Companion.DEFAULT_GRADE +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialFontSettings.Companion.DEFAULT_OPTICAL_SIZE +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialFontSettings.Companion.DEFAULT_WEIGHT import java.util.Collections.emptyList import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/WebImportFlow.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/WebImportFlow.kt index 4c685e105..39c3474f0 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/WebImportFlow.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/WebImportFlow.kt @@ -6,7 +6,6 @@ import com.composegears.tiamat.compose.Navigation import com.composegears.tiamat.compose.navDestination import com.composegears.tiamat.compose.navigationSlideInOut import com.composegears.tiamat.compose.rememberNavController -import io.github.composegears.valkyrie.ui.screen.webimport.material.MaterialSymbolsImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.bootstrap.BootstrapImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.boxicons.BoxIconsImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.eva.EvaImportScreen @@ -14,6 +13,7 @@ import io.github.composegears.valkyrie.ui.screen.webimport.standard.feather.Feat import io.github.composegears.valkyrie.ui.screen.webimport.standard.fontawesome.FontAwesomeImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.ionicons.IoniconsImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.lucide.LucideImportScreen +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.MaterialSymbolsImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.remix.RemixImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.tabler.TablerImportScreen diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/WebImportSelectorScreen.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/WebImportSelectorScreen.kt index 6487c4756..702c12c6c 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/WebImportSelectorScreen.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/WebImportSelectorScreen.kt @@ -42,7 +42,6 @@ import io.github.composegears.valkyrie.ui.screen.webimport.IconProviders.Ionicon import io.github.composegears.valkyrie.ui.screen.webimport.IconProviders.Lucide import io.github.composegears.valkyrie.ui.screen.webimport.IconProviders.Remix import io.github.composegears.valkyrie.ui.screen.webimport.IconProviders.Tabler -import io.github.composegears.valkyrie.ui.screen.webimport.material.MaterialSymbolsImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.bootstrap.BootstrapImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.boxicons.BoxIconsImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.eva.EvaImportScreen @@ -50,6 +49,7 @@ import io.github.composegears.valkyrie.ui.screen.webimport.standard.feather.Feat import io.github.composegears.valkyrie.ui.screen.webimport.standard.fontawesome.FontAwesomeImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.ionicons.IoniconsImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.lucide.LucideImportScreen +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.MaterialSymbolsImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.remix.RemixImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.tabler.TablerImportScreen import io.github.composegears.valkyrie.util.stringResource diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/StandardIconViewModel.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/StandardIconViewModel.kt similarity index 85% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/StandardIconViewModel.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/StandardIconViewModel.kt index f8427c7b9..0850c0079 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/StandardIconViewModel.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/StandardIconViewModel.kt @@ -1,4 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common +package io.github.composegears.valkyrie.ui.screen.webimport.common import androidx.compose.runtime.Stable import androidx.lifecycle.ViewModel @@ -8,21 +8,23 @@ import com.composegears.tiamat.navigation.asStateFlow import com.composegears.tiamat.navigation.recordOf import io.github.composegears.valkyrie.parser.unified.util.IconNameFormatter import io.github.composegears.valkyrie.sdk.core.extensions.safeAs -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.FontByteArray -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.GridItem -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.StandardIconProvider -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.InferredCategory -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIcon -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIconConfig -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.util.filterByCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.StandardIconProvider +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.GridItem +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.filterByCategory +import kotlin.coroutines.cancellation.CancellationException import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import kotlinx.coroutines.yield class StandardIconViewModel( savedState: MutableSavedState, @@ -67,6 +69,8 @@ class StandardIconViewModel( val styleKey = normalizedSelectedStyle?.id restoredFont?.let { fontCache[styleKey] = it } + provider.onStyleChanged(normalizedSelectedStyle) + if (restoredFont == null) { downloadFont(normalizedSelectedStyle) } @@ -105,6 +109,7 @@ class StandardIconViewModel( settings = SizeSettings(size = provider.persistentSize), selectedStyle = selectedStyle, ) + provider.onStyleChanged(selectedStyle) downloadFont(selectedStyle) prefetchStyleFonts( styles = config.styles, @@ -128,10 +133,18 @@ class StandardIconViewModel( if (cachedFont == null) { updateSuccess { it.copy(fontByteArray = null) } + // Yield so Compose renders the skeleton before font bytes arrive. + // Without this, providers with in-memory caches (suspendLazy) return + // instantly — both state updates are batched into one frame and the + // skeleton is never visible. + yield() runCatching { val bytes = provider.loadFontBytes(resolvedStyle) fontCache[styleKey] = bytes updateSuccess { it.copy(fontByteArray = bytes) } + }.onFailure { error -> + if (error is CancellationException) throw error + updateSuccess { it.copy(fontByteArray = null) } } } else { updateSuccess { it.copy(fontByteArray = cachedFont) } @@ -145,7 +158,7 @@ class StandardIconViewModel( val currentState = stateRecord.value.safeAs() ?: return@launch runCatching { - val svgContent = provider.downloadSvg(icon, currentState.settings) + val svgContent = provider.downloadSvg(icon, currentState.settings, currentState.selectedStyle) _events.send( StandardIconEvent.IconDownloaded( @@ -177,6 +190,7 @@ class StandardIconViewModel( val cachedFont = withContext(Dispatchers.Main.immediate) { fontCache[style.id] } + provider.onStyleChanged(style) updateSuccess { state -> state.copy( selectedStyle = style, diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/StandardImportScreenUI.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/StandardImportScreenUI.kt similarity index 70% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/StandardImportScreenUI.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/StandardImportScreenUI.kt index 7fec85e75..80e8fad5d 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/StandardImportScreenUI.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/StandardImportScreenUI.kt @@ -1,16 +1,24 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common +package io.github.composegears.valkyrie.ui.screen.webimport.common import androidx.compose.animation.AnimatedContent import androidx.compose.foundation.gestures.detectTapGestures +import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size +import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.grid.GridItemSpan +import androidx.compose.foundation.lazy.grid.LazyGridScope import androidx.compose.foundation.lazy.grid.LazyGridState +import androidx.compose.foundation.lazy.grid.LazyVerticalGrid import androidx.compose.foundation.lazy.grid.items import androidx.compose.foundation.lazy.grid.rememberLazyGridState +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue @@ -19,8 +27,10 @@ import androidx.compose.runtime.rememberUpdatedState import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.platform.LocalFocusManager +import androidx.compose.ui.text.font.FontVariation import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.composegears.tiamat.compose.saveableViewModel @@ -39,27 +49,29 @@ import io.github.composegears.valkyrie.jewel.ui.placeholder.LoadingPlaceholder import io.github.composegears.valkyrie.sdk.compose.foundation.ObserveEvent import io.github.composegears.valkyrie.sdk.compose.foundation.animation.Shimmer import io.github.composegears.valkyrie.sdk.compose.foundation.animation.rememberShimmer +import io.github.composegears.valkyrie.sdk.compose.foundation.animation.shimmer import io.github.composegears.valkyrie.sdk.compose.foundation.rememberMutableState -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.CategoryHeader -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.GridItem -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.IconItem -import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.CategoryHeader +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.StandardIconProvider +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.VariableFontConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.CategoryHeader +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.GridItem +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconItem +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.CategoryHeaderItem import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.IconCard -import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.IconGrid -import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.IconLoadingPlaceholder import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.IconSizeCustomization import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.SidePanel +import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.StandardTopActions import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.ZOOM_DEFAULT_SCALE import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.ZoomFloatingBar -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.StandardIconProvider -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.InferredCategory -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIcon -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.ui.StandardTopActions import io.github.composegears.valkyrie.util.stringResource import kotlinx.coroutines.launch import org.jetbrains.jewel.foundation.theme.LocalContentColor +import org.jetbrains.jewel.ui.component.VerticalScrollbar @Composable internal fun StandardImportScreen( @@ -67,12 +79,14 @@ internal fun StandardImportScreen( provider: StandardIconProvider, onIconDownload: (event: StandardIconEvent.IconDownloaded) -> Unit, onBack: () -> Unit, + customizationContent: (@Composable (onClose: () -> Unit) -> Unit)? = null, modifier: Modifier = Modifier, ) { val viewModel = saveableViewModel { StandardIconViewModel(savedState = it, provider = provider) } val state by viewModel.state.collectAsState() + val variableFontConfig by provider.variableFontConfig.collectAsState() val currentOnIconDownloaded by rememberUpdatedState(onIconDownload) ObserveEvent(viewModel.events) { event -> @@ -88,6 +102,8 @@ internal fun StandardImportScreen( title = title, fontAlias = provider.fontAlias, resolveFontWeight = provider::resolveFontWeight, + variableFontConfig = variableFontConfig, + customizationContent = customizationContent, onBack = onBack, onSelectIcon = viewModel::downloadIcon, onSelectCategory = viewModel::selectCategory, @@ -104,6 +120,8 @@ private fun StandardImportScreenUI( title: String, fontAlias: String, resolveFontWeight: (IconStyle?) -> FontWeight, + variableFontConfig: VariableFontConfig?, + customizationContent: (@Composable (onClose: () -> Unit) -> Unit)?, onBack: () -> Unit, onSelectIcon: (StandardIcon) -> Unit, onSelectCategory: (InferredCategory) -> Unit, @@ -153,6 +171,8 @@ private fun StandardImportScreenUI( state = current, fontAlias = fontAlias, resolveFontWeight = resolveFontWeight, + variableFontConfig = variableFontConfig, + customizationContent = customizationContent, onSelectIcon = onSelectIcon, onSelectCategory = onSelectCategory, onSelectStyle = onSelectStyle, @@ -170,6 +190,8 @@ private fun IconsContent( state: StandardState.Success, fontAlias: String, resolveFontWeight: (IconStyle?) -> FontWeight, + variableFontConfig: VariableFontConfig?, + customizationContent: (@Composable (onClose: () -> Unit) -> Unit)?, onSelectIcon: (StandardIcon) -> Unit, onSelectCategory: (InferredCategory) -> Unit, onSelectStyle: (IconStyle) -> Unit, @@ -245,13 +267,16 @@ private fun IconsContent( ?.id ?.let { "$fontAlias-$it" } ?: fontAlias - val styleAwareWeight = resolveFontWeight(state.selectedStyle) + val styleAwareWeight = variableFontConfig?.weight ?: resolveFontWeight(state.selectedStyle) val iconFont = rememberStandardFont( - font = state.fontByteArray.bytes, + font = state.fontByteArray, alias = styleAwareAlias, weight = styleAwareWeight, + weights = variableFontConfig?.weights, + fontVariationSettings = variableFontConfig?.variation, ) - val iconSizeDp = (state.settings.size * scaleFactor).dp + val iconSizeDp = + ((variableFontConfig?.opticalSize ?: state.settings.size.toFloat()) * scaleFactor).dp ProvideIconParameters( iconFont = iconFont, @@ -296,12 +321,16 @@ private fun IconsContent( isOpen = isSidePanelOpen, onClose = { isSidePanelOpen = false }, content = { - IconSizeCustomization( - settings = state.settings, - onSettingsChange = onSettingsChange, - onClose = { isSidePanelOpen = false }, - sizeLabel = stringResource("web.import.font.customize.size"), - ) + if (customizationContent != null) { + customizationContent { isSidePanelOpen = false } + } else { + IconSizeCustomization( + settings = state.settings, + onSettingsChange = onSettingsChange, + onClose = { isSidePanelOpen = false }, + sizeLabel = stringResource("web.import.font.customize.size"), + ) + } }, ) } @@ -325,8 +354,8 @@ private fun StandardIconGrid( }, ) { item: GridItem -> when (item) { - is CategoryHeader -> CategoryHeader(title = item.categoryName) - is IconItem<*> -> iconContent(item.icon as StandardIcon) + is CategoryHeader -> CategoryHeaderItem(title = item.categoryName) + is IconItem<*> -> (item.icon as? StandardIcon)?.let { iconContent(it) } } } } @@ -350,11 +379,73 @@ private fun StandardIconStub( @OptIn(ExperimentalFontIconsApi::class) @Composable private fun rememberStandardFont( - font: ByteArray, + font: FontByteArray, alias: String, weight: FontWeight, -): IconFont = rememberVariableIconFont( - alias = alias, - data = font, - weights = arrayOf(weight), -) + weights: List? = null, + fontVariationSettings: FontVariation.Settings? = null, +): IconFont = when (fontVariationSettings) { + null -> rememberVariableIconFont( + alias = alias, + data = font.bytes, + weights = weights?.toTypedArray() ?: arrayOf(weight), + ) + else -> rememberVariableIconFont( + alias = alias, + data = font.bytes, + weights = weights?.toTypedArray() ?: arrayOf(weight), + fontVariationSettings = fontVariationSettings, + ) +} + +/** + * Shared icon grid for web import screens. + * Provides a consistent grid layout with scrollbar. + * + * @param state The LazyGridState for the grid + * @param modifier Modifier to be applied to the container + * @param content The content of the grid + */ +@Composable +private fun IconGrid( + state: LazyGridState, + modifier: Modifier = Modifier, + content: LazyGridScope.() -> Unit, +) { + Box(modifier = modifier) { + LazyVerticalGrid( + state = state, + modifier = Modifier.fillMaxSize(), + columns = GridCells.Adaptive(100.dp), + contentPadding = PaddingValues(16.dp), + horizontalArrangement = Arrangement.spacedBy(8.dp), + verticalArrangement = Arrangement.spacedBy(8.dp), + content = content, + ) + VerticalScrollbar( + scrollState = state, + modifier = Modifier.fillMaxHeight() + .align(Alignment.CenterEnd) + .padding(end = 4.dp, top = 8.dp, bottom = 4.dp), + ) + } +} + +/** + * Shimmer placeholder for loading icon state. + * + * @param shimmer The shimmer animation to use + * @param modifier Modifier to be applied to the shimmer placeholder + */ +@Composable +private fun IconLoadingPlaceholder( + shimmer: Shimmer, + modifier: Modifier = Modifier, +) { + Spacer( + modifier = modifier + .fillMaxSize() + .clip(RoundedCornerShape(12.dp)) + .shimmer(shimmer = shimmer, cornerRadius = 12.dp), + ) +} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/data/CodepointParser.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/data/CodepointParser.kt similarity index 76% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/data/CodepointParser.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/data/CodepointParser.kt index dcf961f00..1d0f5de48 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/data/CodepointParser.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/data/CodepointParser.kt @@ -1,4 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data +package io.github.composegears.valkyrie.ui.screen.webimport.common.data /** * A strategy that can extract icon name -> codepoint mapping from a CSS text. diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/data/RegexCssCodepointParser.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/data/RegexCssCodepointParser.kt similarity index 89% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/data/RegexCssCodepointParser.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/data/RegexCssCodepointParser.kt index a08db240c..5e26ec21c 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/data/RegexCssCodepointParser.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/data/RegexCssCodepointParser.kt @@ -1,4 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data +package io.github.composegears.valkyrie.ui.screen.webimport.common.data /** * Simple regex-based implementation for typical provider CSS files where rules like diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/CategoryInferrer.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/CategoryInferrer.kt similarity index 95% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/CategoryInferrer.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/CategoryInferrer.kt index 58c666656..136923c3b 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/CategoryInferrer.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/CategoryInferrer.kt @@ -1,6 +1,6 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory /** * Category keyword mapping with priority (lower number = higher priority). diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/StandardIconProvider.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/StandardIconProvider.kt new file mode 100644 index 000000000..a77f9836e --- /dev/null +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/StandardIconProvider.kt @@ -0,0 +1,47 @@ +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain + +import androidx.compose.runtime.Stable +import androidx.compose.ui.text.font.FontWeight +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.VariableFontConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow + +@Stable +interface StandardIconProvider { + val providerName: String + val stateKey: String + val fontAlias: String + val persistentSize: Int + + /** + * Optional variable font configuration for providers that support font variation axes + * (e.g. Material Symbols with FILL, grade, optical size axes). + * Returns a flow of `null` for standard providers that use fixed fonts. + */ + val variableFontConfig: StateFlow + get() = NoVariableFontConfig + + fun updatePersistentSize(value: Int) {} + fun resolveFontWeight(style: IconStyle?): FontWeight = FontWeight.W400 + + /** + * Called by the ViewModel when the selected style changes. + * Override in providers that need to track the current style for SVG downloads + * (e.g. Material Symbols, where style = font family selection, not a per-icon property). + */ + fun onStyleChanged(style: IconStyle?) {} + + suspend fun loadConfig(): StandardIconConfig + suspend fun loadFontBytes(style: IconStyle? = null): FontByteArray + suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings, style: IconStyle? = null): String + + companion object { + /** Shared no-op StateFlow returned by the default [variableFontConfig] getter. */ + private val NoVariableFontConfig: StateFlow = MutableStateFlow(null) + } +} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/InferredCategory.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/category/InferredCategory.kt similarity index 68% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/InferredCategory.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/category/InferredCategory.kt index fb3e08dac..afd388525 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/InferredCategory.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/category/InferredCategory.kt @@ -1,6 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model - -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.WebCategory +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category /** * Category inferred from icon names and tags using keyword matching. @@ -10,6 +8,7 @@ data class InferredCategory( val id: String, override val name: String, ) : WebCategory { + companion object { val All = InferredCategory(id = "all", name = "All") } diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/WebCategory.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/category/WebCategory.kt similarity index 85% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/WebCategory.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/category/WebCategory.kt index d931ef3fa..466c1760e 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/WebCategory.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/category/WebCategory.kt @@ -1,4 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.common.model +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category interface WebCategory { val name: String diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/Codepoint.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/font/Codepoint.kt similarity index 73% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/Codepoint.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/font/Codepoint.kt index e676aa40c..22e51794f 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/Codepoint.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/font/Codepoint.kt @@ -1,4 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font @JvmInline value class Codepoint(val value: Int) { diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/FontByteArray.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/font/FontByteArray.kt similarity index 66% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/FontByteArray.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/font/FontByteArray.kt index ac3238ab7..734831794 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/FontByteArray.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/font/FontByteArray.kt @@ -1,4 +1,7 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.common.model +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font +import androidx.compose.runtime.Stable + +@Stable @JvmInline value class FontByteArray(val bytes: ByteArray) diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/font/VariableFontConfig.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/font/VariableFontConfig.kt new file mode 100644 index 000000000..09254a566 --- /dev/null +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/font/VariableFontConfig.kt @@ -0,0 +1,24 @@ +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font + +import androidx.compose.runtime.Stable +import androidx.compose.ui.text.font.FontVariation +import androidx.compose.ui.text.font.FontWeight + +/** + * Configuration for variable fonts that support multiple axes (e.g. fill, grade, optical size). + * + * Used by providers like Material Symbols to control font rendering via variable font technology. + * Standard providers (Lucide, Bootstrap, etc.) do not provide this configuration. + * + * @property variation Font variation settings (axes such as FILL, GRAD, opsz) + * @property weights List of font weights the variable font supports + * @property weight Currently selected weight to use for rendering + * @property opticalSize Optional override for the icon display size (in dp/sp). When null, SizeSettings.size is used + */ +@Stable +data class VariableFontConfig( + val variation: FontVariation.Settings, + val weights: List, + val weight: FontWeight, + val opticalSize: Float? = null, +) diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/GridItem.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/GridItem.kt similarity index 97% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/GridItem.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/GridItem.kt index c468be619..144e01524 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/GridItem.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/GridItem.kt @@ -1,4 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.common.model +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon /** * Base interface for grid items that can be displayed in icon grids diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/IconStyle.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/IconStyle.kt new file mode 100644 index 000000000..db0833dae --- /dev/null +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/IconStyle.kt @@ -0,0 +1,6 @@ +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon + +data class IconStyle( + val id: String, + val name: String, +) diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/StandardIcon.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/StandardIcon.kt similarity index 78% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/StandardIcon.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/StandardIcon.kt index 21088cc1f..012211b1c 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/StandardIcon.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/StandardIcon.kt @@ -1,7 +1,8 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.WebIcon -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.Codepoint +import androidx.compose.runtime.Immutable +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.Codepoint /** * Standard icon model for icon providers that use inferred categories. @@ -14,6 +15,7 @@ import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domai * @property category The inferred category based on name/tags analysis * @property style Optional style variant for providers that separate icon sets by style */ +@Immutable data class StandardIcon( override val name: String, val displayName: String, diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/StandardIconConfig.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/StandardIconConfig.kt similarity index 87% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/StandardIconConfig.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/StandardIconConfig.kt index 4f4b3b9b7..47e383f74 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/StandardIconConfig.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/StandardIconConfig.kt @@ -1,4 +1,6 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon + +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory /** * Configuration model for standard icon providers (Lucide, Bootstrap, etc.). diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/WebIcon.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/WebIcon.kt similarity index 63% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/WebIcon.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/WebIcon.kt index e91cdd373..dbbec4687 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/WebIcon.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/icon/WebIcon.kt @@ -1,5 +1,8 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.common.model +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon +import androidx.compose.runtime.Stable + +@Stable interface WebIcon { val name: String } diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/IconSettings.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/settings/IconSettings.kt similarity index 81% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/IconSettings.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/settings/IconSettings.kt index 96475d553..7fe17dbae 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/model/IconSettings.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/settings/IconSettings.kt @@ -1,9 +1,12 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.common.model +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings + +import androidx.compose.runtime.Stable /** * Common interface for icon settings that can be applied during web import. * Implemented by both standard providers (SizeSettings) and Material (FontSettings). */ +@Stable interface IconSettings { val isModified: Boolean } diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/SizeSettings.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/settings/SizeSettings.kt similarity index 75% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/SizeSettings.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/settings/SizeSettings.kt index d3b33822a..622cdd52a 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/SizeSettings.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/settings/SizeSettings.kt @@ -1,6 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model - -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.IconSettings +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings /** * Size settings for standard icon providers. diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/CategoryHeader.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/CategoryHeaderItem.kt similarity index 92% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/CategoryHeader.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/CategoryHeaderItem.kt index 568470834..6f867b0ab 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/CategoryHeader.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/CategoryHeaderItem.kt @@ -11,7 +11,7 @@ import org.jetbrains.jewel.ui.component.Text import org.jetbrains.jewel.ui.typography @Composable -fun CategoryHeader( +fun CategoryHeaderItem( title: String, modifier: Modifier = Modifier, ) { @@ -27,5 +27,5 @@ fun CategoryHeader( @Preview @Composable private fun CategoryHeaderPreview() = PreviewTheme { - CategoryHeader(title = "Actions") + CategoryHeaderItem(title = "Actions") } diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/IconSizeCustomization.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/IconSizeCustomization.kt index 6b0d12aba..dd63c4416 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/IconSizeCustomization.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/IconSizeCustomization.kt @@ -23,7 +23,7 @@ import io.github.composegears.valkyrie.jewel.tooling.PreviewTheme import io.github.composegears.valkyrie.sdk.compose.foundation.layout.CenterVerticalRow import io.github.composegears.valkyrie.sdk.compose.foundation.layout.WeightSpacer import io.github.composegears.valkyrie.sdk.compose.foundation.rememberMutableState -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings import io.github.composegears.valkyrie.util.stringResource import kotlin.math.roundToInt import org.jetbrains.compose.ui.tooling.preview.Preview diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/SidePanel.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/SidePanel.kt index d8634f2a0..4bb3222c1 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/SidePanel.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/SidePanel.kt @@ -21,8 +21,8 @@ import androidx.compose.ui.unit.dp import io.github.composegears.valkyrie.jewel.colors.overlay import io.github.composegears.valkyrie.jewel.tooling.PreviewTheme import io.github.composegears.valkyrie.sdk.compose.foundation.rememberMutableState -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings -import io.github.composegears.valkyrie.ui.screen.webimport.material.ui.MaterialFontCustomization +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialFontSettings +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.ui.MaterialFontCustomization import org.jetbrains.compose.ui.tooling.preview.Preview import org.jetbrains.jewel.foundation.theme.JewelTheme import org.jetbrains.jewel.ui.component.DefaultButton diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/ui/StandardTopActions.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/StandardTopActions.kt similarity index 91% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/ui/StandardTopActions.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/StandardTopActions.kt index 14d33f252..caea4b0cc 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/ui/StandardTopActions.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/StandardTopActions.kt @@ -1,4 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.ui +package io.github.composegears.valkyrie.ui.screen.webimport.common.ui import androidx.compose.foundation.layout.width import androidx.compose.runtime.Composable @@ -9,9 +9,9 @@ import androidx.compose.ui.unit.dp import io.github.composegears.valkyrie.jewel.DropdownList import io.github.composegears.valkyrie.jewel.tooling.PreviewTheme import io.github.composegears.valkyrie.sdk.compose.foundation.rememberMutableState +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.WebImportTopActions -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.InferredCategory import org.jetbrains.compose.ui.tooling.preview.Preview @Composable diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/WebImportScreenComponents.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/WebImportScreenComponents.kt deleted file mode 100644 index 3a1c540a7..000000000 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/WebImportScreenComponents.kt +++ /dev/null @@ -1,74 +0,0 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.common.ui - -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.PaddingValues -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxHeight -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.lazy.grid.GridCells -import androidx.compose.foundation.lazy.grid.LazyGridScope -import androidx.compose.foundation.lazy.grid.LazyGridState -import androidx.compose.foundation.lazy.grid.LazyVerticalGrid -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.unit.dp -import io.github.composegears.valkyrie.sdk.compose.foundation.animation.Shimmer -import io.github.composegears.valkyrie.sdk.compose.foundation.animation.shimmer -import org.jetbrains.jewel.ui.component.VerticalScrollbar - -/** - * Shared icon grid for web import screens. - * Provides a consistent grid layout with scrollbar. - * - * @param state The LazyGridState for the grid - * @param modifier Modifier to be applied to the container - * @param content The content of the grid - */ -@Composable -fun IconGrid( - state: LazyGridState, - modifier: Modifier = Modifier, - content: LazyGridScope.() -> Unit, -) { - Box(modifier = modifier) { - LazyVerticalGrid( - state = state, - modifier = Modifier.fillMaxSize(), - columns = GridCells.Adaptive(100.dp), - contentPadding = PaddingValues(16.dp), - horizontalArrangement = Arrangement.spacedBy(8.dp), - verticalArrangement = Arrangement.spacedBy(8.dp), - content = content, - ) - VerticalScrollbar( - scrollState = state, - modifier = Modifier.fillMaxHeight() - .align(Alignment.CenterEnd) - .padding(end = 4.dp, top = 8.dp, bottom = 4.dp), - ) - } -} - -/** - * Shimmer placeholder for loading icon state. - * - * @param shimmer The shimmer animation to use - * @param modifier Modifier to be applied to the shimmer placeholder - */ -@Composable -fun IconLoadingPlaceholder( - shimmer: Shimmer, - modifier: Modifier = Modifier, -) { - Spacer( - modifier = modifier - .fillMaxSize() - .clip(RoundedCornerShape(12.dp)) - .shimmer(shimmer = shimmer, cornerRadius = 12.dp), - ) -} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/DisplayNameFormatter.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/util/DisplayNameFormatter.kt similarity index 70% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/DisplayNameFormatter.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/util/DisplayNameFormatter.kt index 0536ed8b4..d3a6a51c4 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/DisplayNameFormatter.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/util/DisplayNameFormatter.kt @@ -1,4 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain +package io.github.composegears.valkyrie.ui.screen.webimport.common.util import io.github.composegears.valkyrie.parser.unified.ext.capitalized diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/util/GridFiltering.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/util/GridFiltering.kt index ea3873ddd..eff486cd8 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/util/GridFiltering.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/util/GridFiltering.kt @@ -1,11 +1,11 @@ package io.github.composegears.valkyrie.ui.screen.webimport.common.util import com.github.androidpasswordstore.sublimefuzzy.Fuzzy -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.CategoryHeader -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.GridItem -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.IconItem -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.WebCategory -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.WebIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.WebCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.CategoryHeader +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.GridItem +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconItem +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.WebIcon /** * Converts a map of categories to icons into a flat list of grid items. diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/util/StandardGridFiltering.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/util/StandardGridFiltering.kt similarity index 67% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/util/StandardGridFiltering.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/util/StandardGridFiltering.kt index 51eea04aa..995e1c37d 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/util/StandardGridFiltering.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/util/StandardGridFiltering.kt @@ -1,10 +1,9 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.util +package io.github.composegears.valkyrie.ui.screen.webimport.common.util -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.GridItem -import io.github.composegears.valkyrie.ui.screen.webimport.common.util.filterGridItems -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.InferredCategory -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.GridItem +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIconConfig /** * Filters grid items from a [StandardIconConfig] with support for category, style, and search. @@ -32,7 +31,9 @@ fun StandardIconConfig.filterByCategory( else -> { categoryFiltered .mapValues { (_, icons) -> - icons.filter { icon -> icon.style?.id == style.id } + // Icons with style == null are treated as "belongs to all styles" + // (used by providers like Material Symbols where style = font family, not per-icon variant). + icons.filter { icon -> icon.style == null || icon.style.id == style.id } } .filterValues { it.isNotEmpty() } } diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/SvgSizeCustomizer.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/util/SvgSizeCustomizer.kt similarity index 77% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/SvgSizeCustomizer.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/util/SvgSizeCustomizer.kt index 4214016df..8e00fdbe5 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/SvgSizeCustomizer.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/util/SvgSizeCustomizer.kt @@ -1,7 +1,7 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain +package io.github.composegears.valkyrie.ui.screen.webimport.common.util import io.github.composegears.valkyrie.sdk.utils.svg.SvgDomModifier -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings /** * Utility for applying size settings to SVG content. diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/MaterialSymbolsImportScreen.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/MaterialSymbolsImportScreen.kt deleted file mode 100644 index 17246490b..000000000 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/MaterialSymbolsImportScreen.kt +++ /dev/null @@ -1,372 +0,0 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material - -import androidx.compose.animation.AnimatedContent -import androidx.compose.foundation.gestures.detectTapGestures -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size -import androidx.compose.foundation.lazy.grid.GridItemSpan -import androidx.compose.foundation.lazy.grid.LazyGridState -import androidx.compose.foundation.lazy.grid.items -import androidx.compose.foundation.lazy.grid.rememberLazyGridState -import androidx.compose.runtime.Composable -import androidx.compose.runtime.collectAsState -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.rememberCoroutineScope -import androidx.compose.runtime.saveable.rememberSaveable -import androidx.compose.runtime.setValue -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.input.pointer.pointerInput -import androidx.compose.ui.platform.LocalFocusManager -import androidx.compose.ui.text.font.FontVariation -import androidx.compose.ui.text.font.FontVariation.grade -import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.unit.TextUnit -import androidx.compose.ui.unit.TextUnitType -import androidx.compose.ui.unit.dp -import com.composegears.tiamat.compose.TiamatPreview -import com.composegears.tiamat.compose.back -import com.composegears.tiamat.compose.navController -import com.composegears.tiamat.compose.navDestination -import com.composegears.tiamat.compose.navigate -import com.composegears.tiamat.compose.saveableViewModel -import dev.tclement.fonticons.ExperimentalFontIconsApi -import dev.tclement.fonticons.FontIcon -import dev.tclement.fonticons.IconFont -import dev.tclement.fonticons.ProvideIconParameters -import dev.tclement.fonticons.rememberVariableIconFont -import io.github.composegears.valkyrie.jewel.BackAction -import io.github.composegears.valkyrie.jewel.HorizontalDivider -import io.github.composegears.valkyrie.jewel.Title -import io.github.composegears.valkyrie.jewel.Toolbar -import io.github.composegears.valkyrie.jewel.tooling.ProjectPreviewTheme -import io.github.composegears.valkyrie.jewel.ui.placeholder.EmptyPlaceholder -import io.github.composegears.valkyrie.jewel.ui.placeholder.ErrorPlaceholder -import io.github.composegears.valkyrie.jewel.ui.placeholder.LoadingPlaceholder -import io.github.composegears.valkyrie.sdk.compose.foundation.ObserveEvent -import io.github.composegears.valkyrie.sdk.compose.foundation.animation.Shimmer -import io.github.composegears.valkyrie.sdk.compose.foundation.animation.rememberShimmer -import io.github.composegears.valkyrie.sdk.compose.foundation.rememberMutableState -import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionParamsSource.TextSource -import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionScreen -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.CategoryHeader -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.GridItem -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.IconItem -import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.CategoryHeader -import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.IconCard -import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.IconGrid -import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.IconLoadingPlaceholder -import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.SidePanel -import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.ZOOM_DEFAULT_SCALE -import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.ZoomFloatingBar -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.Category -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.IconModel -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialIconFontFamily -import io.github.composegears.valkyrie.ui.screen.webimport.material.ui.MaterialFontCustomization -import io.github.composegears.valkyrie.ui.screen.webimport.material.ui.MaterialTopActions -import io.github.composegears.valkyrie.util.stringResource -import kotlinx.coroutines.launch -import org.jetbrains.compose.ui.tooling.preview.Preview -import org.jetbrains.jewel.foundation.theme.LocalContentColor - -val MaterialSymbolsImportScreen by navDestination { - val navController = navController() - val parentNavController = navController.parent - - val viewModel = saveableViewModel { MaterialSymbolsViewModel(savedState = it) } - val state by viewModel.materialState.collectAsState() - - ObserveEvent(viewModel.events) { event -> - when (event) { - is MaterialEvent.IconDownloaded -> { - parentNavController?.navigate( - dest = SimpleConversionScreen, - navArgs = TextSource( - name = event.name, - text = event.svgContent, - ), - ) - } - } - } - - MaterialSymbolsImportUI( - state = state, - onBack = navController::back, - onSelectIcon = viewModel::downloadIcon, - onSelectFontFamily = viewModel::downloadFont, - onSelectCategory = viewModel::selectCategory, - onSettingsChange = viewModel::updateFontSettings, - onSearchQueryChange = viewModel::updateSearchQuery, - ) -} - -@Composable -private fun MaterialSymbolsImportUI( - state: MaterialState, - onBack: () -> Unit, - onSelectIcon: (IconModel) -> Unit, - onSelectFontFamily: (MaterialIconFontFamily) -> Unit, - onSelectCategory: (Category) -> Unit, - onSettingsChange: (MaterialFontSettings) -> Unit, - onSearchQueryChange: (String) -> Unit, -) { - var isSidePanelOpen by rememberSaveable { mutableStateOf(false) } - - Column(modifier = Modifier.fillMaxSize()) { - Toolbar { - BackAction(onBack = onBack) - Title(text = stringResource("web.import.title.material")) - } - AnimatedContent( - targetState = state, - contentKey = { - when (it) { - is MaterialState.Loading -> "loading" - is MaterialState.Error -> "error" - is MaterialState.Success -> "success" - } - }, - ) { current -> - when (current) { - is MaterialState.Loading -> { - Box( - modifier = Modifier.fillMaxSize(), - contentAlignment = Alignment.Center, - ) { - LoadingPlaceholder(text = stringResource("web.import.placeholder.loading")) - } - } - is MaterialState.Error -> { - Box( - modifier = Modifier.fillMaxSize(), - contentAlignment = Alignment.Center, - ) { - ErrorPlaceholder(message = current.message) - } - } - is MaterialState.Success -> { - Box(modifier = Modifier.fillMaxSize()) { - IconsContent( - state = current, - onSelectIcon = onSelectIcon, - onSelectFontFamily = onSelectFontFamily, - onSelectCategory = onSelectCategory, - onToggleSidePanel = { isSidePanelOpen = !isSidePanelOpen }, - onSearchQueryChange = onSearchQueryChange, - ) - SidePanel( - isOpen = isSidePanelOpen, - onClose = { isSidePanelOpen = false }, - content = { - MaterialFontCustomization( - fontSettings = current.fontSettings, - onClose = { isSidePanelOpen = false }, - onSettingsChange = onSettingsChange, - ) - }, - ) - } - } - } - } - } -} - -@Composable -private fun IconsContent( - state: MaterialState.Success, - onSelectIcon: (IconModel) -> Unit, - onSelectFontFamily: (MaterialIconFontFamily) -> Unit, - onSelectCategory: (Category) -> Unit, - onToggleSidePanel: () -> Unit, - onSearchQueryChange: (String) -> Unit, -) { - val scope = rememberCoroutineScope() - - var selectedIcon by rememberMutableState { null } - var scaleFactor by rememberMutableState { ZOOM_DEFAULT_SCALE } - val lazyGridState = rememberLazyGridState() - val fontSettings = state.fontSettings - - val fontByteArray = state.fontByteArray - val iconFontFamily = state.iconFontFamily - - val focusManager = LocalFocusManager.current - - Box(modifier = Modifier.fillMaxSize()) { - Column( - modifier = Modifier - .pointerInput(Unit) { - detectTapGestures( - onTap = { - focusManager.clearFocus() - }, - ) - }, - ) { - MaterialTopActions( - categories = state.config.categories, - selectedCategory = state.selectedCategory, - iconFontFamily = iconFontFamily, - onToggleSidePanel = onToggleSidePanel, - onSelectFontFamily = onSelectFontFamily, - onSelectCategory = { category -> - scope.launch { - lazyGridState.scrollToItem(0) - } - onSelectCategory(category) - }, - onSearchQueryChange = onSearchQueryChange, - ) - HorizontalDivider() - if (fontByteArray == null) { - val shimmer = rememberShimmer() - - MaterialIconGrid( - gridItems = state.gridItems, - lazyGridState = lazyGridState, - iconContent = { materialIcon -> - MaterialIconStub( - icon = materialIcon, - shimmer = shimmer, - ) - }, - ) - } else { - val iconFont = rememberMaterialSymbolsFont( - name = iconFontFamily.fontFamily, - font = fontByteArray.bytes, - fill = fontSettings.fill, - grade = fontSettings.grade, - opticalSize = fontSettings.opticalSize, - ) - val iconSizeDp = (fontSettings.opticalSize * scaleFactor).dp - - ProvideIconParameters( - iconFont = iconFont, - tint = LocalContentColor.current, - weight = FontWeight(fontSettings.weight), - ) { - if (state.gridItems.isEmpty()) { - Box( - modifier = Modifier.fillMaxSize(), - contentAlignment = Alignment.Center, - ) { - EmptyPlaceholder(message = stringResource("web.import.placeholder.empty")) - } - } else { - MaterialIconGrid( - gridItems = state.gridItems, - lazyGridState = lazyGridState, - iconContent = { icon -> - IconCard( - name = icon.name, - selected = icon == selectedIcon, - onClick = { - selectedIcon = icon - onSelectIcon(icon) - }, - iconContent = { - FontIcon( - modifier = Modifier.size(iconSizeDp), - icon = Char(icon.codepoint), - contentDescription = null, - ) - }, - ) - }, - ) - } - } - } - } - if (fontByteArray != null) { - ZoomFloatingBar( - modifier = Modifier - .align(Alignment.BottomEnd) - .padding(end = 16.dp, bottom = 8.dp), - scaleFactor = scaleFactor, - onScaleChange = { scaleFactor = it }, - ) - } - } -} - -@Composable -private fun MaterialIconGrid( - gridItems: List, - lazyGridState: LazyGridState, - iconContent: @Composable (IconModel) -> Unit, -) { - IconGrid(state = lazyGridState) { - items( - items = gridItems, - span = { item: GridItem -> - when (item) { - is CategoryHeader -> GridItemSpan(maxLineSpan) - is IconItem<*> -> GridItemSpan(1) - } - }, - key = { it.id }, - ) { item: GridItem -> - when (item) { - is CategoryHeader -> CategoryHeader(title = item.categoryName) - is IconItem<*> -> iconContent(item.icon as IconModel) - } - } - } -} - -@Composable -private fun MaterialIconStub( - icon: IconModel, - shimmer: Shimmer, -) { - IconCard( - name = icon.name, - selected = false, - onClick = { /* No-op during loading */ }, - iconContent = { - IconLoadingPlaceholder(shimmer = shimmer) - }, - ) -} - -@OptIn(ExperimentalFontIconsApi::class) -@Composable -private fun rememberMaterialSymbolsFont( - name: String, - font: ByteArray, - fill: Boolean, - grade: Int, - opticalSize: Float, -): IconFont = rememberVariableIconFont( - alias = name, - data = font, - weights = arrayOf( - FontWeight.W100, - FontWeight.W200, - FontWeight.W300, - FontWeight.W400, - FontWeight.W500, - FontWeight.W600, - FontWeight.W700, - ), - fontVariationSettings = FontVariation.Settings( - FontVariation.Setting("FILL", if (fill) 1f else 0f), - grade(grade), - FontVariation.opticalSizing(TextUnit(opticalSize, TextUnitType.Sp)), - ), -) - -@Preview -@Composable -private fun MaterialSymbolsImportScreenPreview() = ProjectPreviewTheme { - TiamatPreview(MaterialSymbolsImportScreen) -} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/MaterialSymbolsViewModel.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/MaterialSymbolsViewModel.kt deleted file mode 100644 index d6f896afb..000000000 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/MaterialSymbolsViewModel.kt +++ /dev/null @@ -1,224 +0,0 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material - -import androidx.compose.runtime.Stable -import androidx.lifecycle.ViewModel -import androidx.lifecycle.viewModelScope -import com.composegears.leviathan.compose.inject -import com.composegears.tiamat.navigation.MutableSavedState -import com.composegears.tiamat.navigation.asStateFlow -import com.composegears.tiamat.navigation.recordOf -import io.github.composegears.valkyrie.parser.unified.util.IconNameFormatter -import io.github.composegears.valkyrie.sdk.core.extensions.safeAs -import io.github.composegears.valkyrie.ui.di.DI -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.FontByteArray -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.GridItem -import io.github.composegears.valkyrie.ui.screen.webimport.common.util.filterGridItems -import io.github.composegears.valkyrie.ui.screen.webimport.common.util.toGridItems -import io.github.composegears.valkyrie.ui.screen.webimport.material.di.MaterialSymbolsModule -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.Category -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.IconModel -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.MaterialConfig -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialIconFontFamily -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.Job -import kotlinx.coroutines.channels.Channel -import kotlinx.coroutines.flow.receiveAsFlow -import kotlinx.coroutines.launch - -class MaterialSymbolsViewModel(savedState: MutableSavedState) : ViewModel() { - - private val fontCache = mutableMapOf() - private val materialSymbolsConfigUseCase = inject(MaterialSymbolsModule.materialSymbolsConfigUseCase) - private val inMemorySettings = inject(DI.core.inMemorySettings) - - private val materialRecord = savedState.recordOf( - key = "materialSymbols", - initialValue = MaterialState.Loading, - ) - val materialState = materialRecord.asStateFlow() - - private val _events = Channel() - val events = _events.receiveAsFlow() - - private var currentFontFamily: MaterialIconFontFamily = MaterialIconFontFamily.Outlined - private var iconLoadJob: Job? = null - - init { - when (val current = materialRecord.value) { - is MaterialState.Success -> if (current.fontByteArray == null) { - downloadFont(current.iconFontFamily) - } - else -> loadConfig() - } - } - - private fun loadConfig() { - viewModelScope.launch { - materialRecord.value = MaterialState.Loading - - runCatching { - val initialSettings = inMemorySettings.readState { - MaterialFontSettings( - fill = materialFontFill, - weight = materialFontWeight, - grade = materialFontGrade, - opticalSize = materialFontOpticalSize, - ) - } - val config = materialSymbolsConfigUseCase.loadConfig() - materialRecord.value = MaterialState.Success( - config = config, - gridItems = config.gridItems.toGridItems(), - fontSettings = initialSettings, - ) - downloadFont(MaterialIconFontFamily.Outlined) - }.onFailure { - materialRecord.value = MaterialState.Error("Error loading Material Symbols config: ${it.message}") - } - } - } - - fun downloadFont(iconFontFamily: MaterialIconFontFamily) { - currentFontFamily = iconFontFamily - viewModelScope.launch { - val cachedFont = fontCache[iconFontFamily] - - if (cachedFont == null) { - if (currentFontFamily == iconFontFamily) { - updateSuccess { it.copy(fontByteArray = null, iconFontFamily = iconFontFamily) } - } - - runCatching { - val font = materialSymbolsConfigUseCase.loadFont(iconFontFamily) - // Always cache the downloaded font - fontCache[iconFontFamily] = font - - if (currentFontFamily == iconFontFamily) { - updateSuccess { - it.copy( - fontByteArray = font, - iconFontFamily = iconFontFamily, - ) - } - } - }.onFailure { e -> - if (currentFontFamily == iconFontFamily) { - materialRecord.value = MaterialState.Error("Error loading Material Symbols font: ${e.message}") - } - } - } else { - updateSuccess { - it.copy( - fontByteArray = cachedFont, - iconFontFamily = iconFontFamily, - ) - } - } - } - } - - fun downloadIcon(icon: IconModel) { - iconLoadJob?.cancel() - iconLoadJob = viewModelScope.launch { - val state = materialRecord.value.safeAs() ?: return@launch - - val svgContent = materialSymbolsConfigUseCase.loadIcon( - name = icon.originalName, - fontFamily = state.iconFontFamily.fontFamily, - fontSettings = state.fontSettings, - ) - - _events.send( - MaterialEvent.IconDownloaded( - svgContent = svgContent, - name = IconNameFormatter.format(icon.name), - ), - ) - } - } - - fun selectCategory(category: Category) { - viewModelScope.launch(Dispatchers.Default) { - updateSuccess { state -> - state.copy( - selectedCategory = category, - gridItems = filterGridItems( - config = state.config, - category = category, - ), - ) - } - } - } - - fun updateSearchQuery(query: String) { - viewModelScope.launch(Dispatchers.Default) { - updateSuccess { state -> - state.copy( - gridItems = filterGridItems( - config = state.config, - category = state.selectedCategory, - searchQuery = query, - ), - ) - } - } - } - - private fun filterGridItems( - config: MaterialConfig, - category: Category, - searchQuery: String = "", - ): List = config - .gridItems - .filterGridItems( - category = category.takeUnless { it == Category.All }, - searchQuery = searchQuery, - ) - - fun updateFontSettings(fontSettings: MaterialFontSettings) { - viewModelScope.launch { - inMemorySettings.update { - materialFontFill = fontSettings.fill - materialFontWeight = fontSettings.weight - materialFontGrade = fontSettings.grade - materialFontOpticalSize = fontSettings.opticalSize - } - updateSuccess { state -> - state.copy(fontSettings = fontSettings) - } - } - } - - private inline fun updateSuccess(crossinline transform: (MaterialState.Success) -> MaterialState.Success) { - val current = materialRecord.value - if (current is MaterialState.Success) { - materialRecord.value = transform(current) - } - } -} - -sealed interface MaterialEvent { - data class IconDownloaded( - val svgContent: String, - val name: String, - ) : MaterialEvent -} - -@Stable -sealed interface MaterialState { - data object Loading : MaterialState - - @Stable - data class Success( - val config: MaterialConfig, - val gridItems: List = emptyList(), - val selectedCategory: Category = Category.All, - val fontSettings: MaterialFontSettings, - val iconFontFamily: MaterialIconFontFamily = MaterialIconFontFamily.Outlined, - val fontByteArray: FontByteArray? = null, - ) : MaterialState - - data class Error(val message: String) : MaterialState -} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/di/MaterialSymbolsModule.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/di/MaterialSymbolsModule.kt deleted file mode 100644 index fb42e4d82..000000000 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/di/MaterialSymbolsModule.kt +++ /dev/null @@ -1,28 +0,0 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material.di - -import com.composegears.leviathan.Leviathan -import io.github.composegears.valkyrie.ui.screen.webimport.common.di.NetworkModule -import io.github.composegears.valkyrie.ui.screen.webimport.common.di.NetworkModule.httpClient -import io.github.composegears.valkyrie.ui.screen.webimport.material.data.config.MaterialSymbolsConfigRepository -import io.github.composegears.valkyrie.ui.screen.webimport.material.data.font.MaterialFontRepository -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.MaterialSymbolsConfigUseCase - -object MaterialSymbolsModule : Leviathan() { - private val network = NetworkModule - - private val materialSymbolsConfigRepository by instanceOf { - MaterialSymbolsConfigRepository( - httpClient = inject(network.httpClient), - json = inject(network.json), - ) - } - private val materialFontRepository by instanceOf { - MaterialFontRepository(httpClient = inject(httpClient)) - } - val materialSymbolsConfigUseCase by instanceOf { - MaterialSymbolsConfigUseCase( - configRepository = inject(materialSymbolsConfigRepository), - fontRepository = inject(materialFontRepository), - ) - } -} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/MaterialSymbolsConfigUseCase.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/MaterialSymbolsConfigUseCase.kt deleted file mode 100644 index 726f8f9f2..000000000 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/MaterialSymbolsConfigUseCase.kt +++ /dev/null @@ -1,83 +0,0 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material.domain - -import io.github.composegears.valkyrie.parser.unified.ext.capitalized -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.FontByteArray -import io.github.composegears.valkyrie.ui.screen.webimport.material.data.config.MaterialSymbolsConfigRepository -import io.github.composegears.valkyrie.ui.screen.webimport.material.data.font.MaterialFontRepository -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.Category -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.IconModel -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.MaterialConfig -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialIconFontFamily - -class MaterialSymbolsConfigUseCase( - private val configRepository: MaterialSymbolsConfigRepository, - private val fontRepository: MaterialFontRepository, -) { - suspend fun loadConfig(): MaterialConfig { - val result = configRepository.load() - - // Filter only Material Symbols icons (exclude older Material Icons families) - val filteredIcons = result.icons.filterNot { icon -> - icon.unsupportedFamilies.any { family -> family.startsWith("Material Icons") } - } - - val categories = filteredIcons - .flatMap { it.categories } - .distinct() - .sorted() - .map { Category(name = it.toCategoryName()) } - - val icons = filteredIcons.map { icon -> - IconModel( - name = icon.name.toIconName(), - originalName = icon.name, - codepoint = icon.codepoint, - category = Category( - name = (icon.categories.firstOrNull() ?: "uncategorized").toCategoryName(), - ), - ) - } - - return MaterialConfig( - gridItems = icons.groupBy { it.category }, - categories = listOf(Category.All) + categories, - ) - } - - suspend fun loadFont(iconFontFamily: MaterialIconFontFamily): FontByteArray { - val bytes = fontRepository.downloadFont(iconFontFamily.cdnUrl) - - return FontByteArray(bytes = bytes) - } - - suspend fun loadIcon( - name: String, - fontFamily: String, - fontSettings: MaterialFontSettings, - ): String { - return fontRepository.downloadSvg( - name = name, - fontFamily = fontFamily, - fontSettings = fontSettings, - ) - } -} - -private fun String.toIconName(): String { - return replace('_', ' ') - .split(' ') - .joinToString( - separator = " ", - transform = { - it.capitalized() - }, - ) -} - -private fun String.toCategoryName(): String { - return when (lowercase()) { - "av" -> "Audio & Video" - else -> capitalized() - } -} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/model/Category.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/model/Category.kt deleted file mode 100644 index 96e52a270..000000000 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/model/Category.kt +++ /dev/null @@ -1,12 +0,0 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model - -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.WebCategory - -@JvmInline -value class Category( - override val name: String, -) : WebCategory { - companion object { - val All = Category("All") - } -} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/model/MaterialConfig.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/model/MaterialConfig.kt deleted file mode 100644 index 97787c67c..000000000 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/model/MaterialConfig.kt +++ /dev/null @@ -1,15 +0,0 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model - -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.WebIcon - -data class MaterialConfig( - val gridItems: Map>, - val categories: List, -) - -data class IconModel( - override val name: String, - val originalName: String, - val codepoint: Int, - val category: Category, -) : WebIcon diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/ui/MaterialFontFamilyDropdown.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/ui/MaterialFontFamilyDropdown.kt deleted file mode 100644 index ce89a4b10..000000000 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/ui/MaterialFontFamilyDropdown.kt +++ /dev/null @@ -1,41 +0,0 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material.ui - -import androidx.compose.foundation.layout.width -import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.setValue -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp -import io.github.composegears.valkyrie.jewel.DropdownList -import io.github.composegears.valkyrie.jewel.tooling.PreviewTheme -import io.github.composegears.valkyrie.sdk.compose.foundation.rememberMutableState -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialIconFontFamily -import org.jetbrains.compose.ui.tooling.preview.Preview - -@Composable -fun MaterialFontFamilyDropdown( - fontFamily: MaterialIconFontFamily, - modifier: Modifier = Modifier, - onSelectFontFamily: (MaterialIconFontFamily) -> Unit, -) { - DropdownList( - modifier = modifier, - items = MaterialIconFontFamily.entries, - selected = fontFamily, - transform = { it.displayName }, - onSelectItem = onSelectFontFamily, - ) -} - -@Preview -@Composable -private fun MaterialFontFamilyDropdownPreview() = PreviewTheme(alignment = Alignment.Center) { - var fontFamily by rememberMutableState { MaterialIconFontFamily.Outlined } - - MaterialFontFamilyDropdown( - modifier = Modifier.width(100.dp), - fontFamily = fontFamily, - onSelectFontFamily = { fontFamily = it }, - ) -} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/ui/MaterialTopActions.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/ui/MaterialTopActions.kt deleted file mode 100644 index a75e46601..000000000 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/ui/MaterialTopActions.kt +++ /dev/null @@ -1,69 +0,0 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material.ui - -import androidx.compose.foundation.layout.width -import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.setValue -import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp -import io.github.composegears.valkyrie.jewel.DropdownList -import io.github.composegears.valkyrie.jewel.tooling.PreviewTheme -import io.github.composegears.valkyrie.sdk.compose.foundation.rememberMutableState -import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.WebImportTopActions -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.Category -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialIconFontFamily -import org.jetbrains.compose.ui.tooling.preview.Preview - -@Composable -fun MaterialTopActions( - categories: List, - selectedCategory: Category, - iconFontFamily: MaterialIconFontFamily, - onToggleSidePanel: () -> Unit, - onSelectFontFamily: (MaterialIconFontFamily) -> Unit, - onSelectCategory: (Category) -> Unit, - onSearchQueryChange: (String) -> Unit, - modifier: Modifier = Modifier, -) { - WebImportTopActions( - modifier = modifier, - onToggleCustomization = onToggleSidePanel, - onSearchQueryChange = onSearchQueryChange, - actionsContent = { - MaterialFontFamilyDropdown( - modifier = Modifier.width(100.dp), - fontFamily = iconFontFamily, - onSelectFontFamily = onSelectFontFamily, - ) - DropdownList( - modifier = Modifier.width(100.dp), - selected = selectedCategory, - items = categories, - transform = { it.name }, - onSelectItem = onSelectCategory, - maxPopupWidth = 120.dp, - ) - }, - ) -} - -@Preview -@Composable -private fun MaterialTopActionsPreview() = PreviewTheme { - var category by rememberMutableState { Category("Action") } - var fontFamily by rememberMutableState { MaterialIconFontFamily.Outlined } - - MaterialTopActions( - selectedCategory = category, - categories = listOf( - Category("Action"), - Category("Alert"), - Category("Audio & Video"), - ), - iconFontFamily = fontFamily, - onToggleSidePanel = {}, - onSelectFontFamily = { fontFamily = it }, - onSelectCategory = { category = it }, - onSearchQueryChange = {}, - ) -} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/BootstrapImportScreen.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/BootstrapImportScreen.kt index a9cab38b7..d65a988be 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/BootstrapImportScreen.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/BootstrapImportScreen.kt @@ -10,8 +10,8 @@ import com.composegears.tiamat.compose.navigate import io.github.composegears.valkyrie.jewel.tooling.ProjectPreviewTheme import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionParamsSource.TextSource import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionScreen +import io.github.composegears.valkyrie.ui.screen.webimport.common.StandardImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.bootstrap.di.BootstrapModule -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.StandardImportScreen import io.github.composegears.valkyrie.util.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/data/BootstrapCodepointParser.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/data/BootstrapCodepointParser.kt index 42820dc22..07acdedc9 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/data/BootstrapCodepointParser.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/data/BootstrapCodepointParser.kt @@ -1,6 +1,6 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.bootstrap.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data.RegexCssCodepointParser +import io.github.composegears.valkyrie.ui.screen.webimport.common.data.RegexCssCodepointParser class BootstrapCodepointParser : RegexCssCodepointParser( diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/data/BootstrapRepository.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/data/BootstrapRepository.kt index 4b6bb28c1..7d707aedc 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/data/BootstrapRepository.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/data/BootstrapRepository.kt @@ -1,6 +1,6 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.bootstrap.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data.CodepointParser +import io.github.composegears.valkyrie.ui.screen.webimport.common.data.CodepointParser import io.github.composegears.valkyrie.util.coroutines.suspendLazy import io.github.composegears.valkyrie.util.font.Woff2Decoder import io.ktor.client.HttpClient diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/domain/BootstrapUseCase.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/domain/BootstrapUseCase.kt index c33f636d3..6d6bb0860 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/domain/BootstrapUseCase.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/bootstrap/domain/BootstrapUseCase.kt @@ -1,18 +1,18 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.bootstrap.domain import io.github.composegears.valkyrie.settings.InMemorySettings -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.StandardIconProvider +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.Codepoint +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.inferCategoryFromTags +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.SvgSizeCustomizer +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.toDisplayName import io.github.composegears.valkyrie.ui.screen.webimport.standard.bootstrap.data.BootstrapRepository -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.Codepoint -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.StandardIconProvider -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.SvgSizeCustomizer -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.inferCategoryFromTags -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.toDisplayName -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIcon -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIconConfig -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.toStandardIconConfig class BootstrapUseCase( private val repository: BootstrapRepository, @@ -50,7 +50,7 @@ class BootstrapUseCase( return FontByteArray(repository.loadFontBytes()) } - override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings): String { + override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings, style: IconStyle?): String { val rawSvg = repository.downloadSvg(icon.name) return SvgSizeCustomizer.applySettings(rawSvg, settings) } diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/BoxIconsImportScreen.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/BoxIconsImportScreen.kt index 8520b1123..d7ad09a20 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/BoxIconsImportScreen.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/BoxIconsImportScreen.kt @@ -10,8 +10,8 @@ import com.composegears.tiamat.compose.navigate import io.github.composegears.valkyrie.jewel.tooling.ProjectPreviewTheme import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionParamsSource.TextSource import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionScreen +import io.github.composegears.valkyrie.ui.screen.webimport.common.StandardImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.boxicons.di.BoxIconsModule -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.StandardImportScreen import io.github.composegears.valkyrie.util.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/data/BoxCodepointParser.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/data/BoxCodepointParser.kt index 9fd73ab70..664d275b0 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/data/BoxCodepointParser.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/data/BoxCodepointParser.kt @@ -1,6 +1,6 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.boxicons.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data.RegexCssCodepointParser +import io.github.composegears.valkyrie.ui.screen.webimport.common.data.RegexCssCodepointParser class BoxCodepointParser : RegexCssCodepointParser( diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/data/BoxIconsRepository.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/data/BoxIconsRepository.kt index 3691138d6..94160f520 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/data/BoxIconsRepository.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/data/BoxIconsRepository.kt @@ -1,6 +1,6 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.boxicons.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data.CodepointParser +import io.github.composegears.valkyrie.ui.screen.webimport.common.data.CodepointParser import io.github.composegears.valkyrie.util.coroutines.suspendLazy import io.github.composegears.valkyrie.util.font.Woff2Decoder import io.ktor.client.HttpClient diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/domain/BoxIconsUseCase.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/domain/BoxIconsUseCase.kt index 97ab4c940..9a6c39028 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/domain/BoxIconsUseCase.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/boxicons/domain/BoxIconsUseCase.kt @@ -1,18 +1,18 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.boxicons.domain import io.github.composegears.valkyrie.settings.InMemorySettings -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.StandardIconProvider +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.Codepoint +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.inferCategoryFromTags +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.SvgSizeCustomizer +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.toDisplayName import io.github.composegears.valkyrie.ui.screen.webimport.standard.boxicons.data.BoxIconsRepository -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.Codepoint -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.StandardIconProvider -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.SvgSizeCustomizer -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.inferCategoryFromTags -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.toDisplayName -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIcon -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIconConfig -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.toStandardIconConfig class BoxIconsUseCase( private val repository: BoxIconsRepository, @@ -53,7 +53,7 @@ class BoxIconsUseCase( return FontByteArray(repository.loadFontBytes()) } - override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings): String { + override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings, style: IconStyle?): String { val rawSvg = repository.downloadSvg(icon.name) return SvgSizeCustomizer.applySettings(rawSvg, settings) } diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/StandardIconProvider.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/StandardIconProvider.kt deleted file mode 100644 index 521f701bf..000000000 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/StandardIconProvider.kt +++ /dev/null @@ -1,22 +0,0 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain - -import androidx.compose.ui.text.font.FontWeight -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.FontByteArray -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIcon -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIconConfig - -interface StandardIconProvider { - val providerName: String - val stateKey: String - val fontAlias: String - val persistentSize: Int - - fun updatePersistentSize(value: Int) - fun resolveFontWeight(style: IconStyle?): FontWeight = FontWeight.W400 - - suspend fun loadConfig(): StandardIconConfig - suspend fun loadFontBytes(style: IconStyle? = null): FontByteArray - suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings): String -} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/IconStyle.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/IconStyle.kt deleted file mode 100644 index bf73debce..000000000 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/model/IconStyle.kt +++ /dev/null @@ -1,6 +0,0 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model - -data class IconStyle( - val id: String, - val name: String, -) diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/EvaImportScreen.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/EvaImportScreen.kt index 81d92a3d0..94d219540 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/EvaImportScreen.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/EvaImportScreen.kt @@ -10,7 +10,7 @@ import com.composegears.tiamat.compose.navigate import io.github.composegears.valkyrie.jewel.tooling.ProjectPreviewTheme import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionParamsSource.TextSource import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionScreen -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.StandardImportScreen +import io.github.composegears.valkyrie.ui.screen.webimport.common.StandardImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.eva.di.EvaModule import io.github.composegears.valkyrie.util.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/data/EvaCodepointParser.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/data/EvaCodepointParser.kt index d9ca6d143..626d27dfb 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/data/EvaCodepointParser.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/data/EvaCodepointParser.kt @@ -1,6 +1,6 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.eva.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data.RegexCssCodepointParser +import io.github.composegears.valkyrie.ui.screen.webimport.common.data.RegexCssCodepointParser class EvaCodepointParser : RegexCssCodepointParser( diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/data/EvaRepository.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/data/EvaRepository.kt index df8ff8441..173706f88 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/data/EvaRepository.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/data/EvaRepository.kt @@ -1,6 +1,6 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.eva.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data.CodepointParser +import io.github.composegears.valkyrie.ui.screen.webimport.common.data.CodepointParser import io.github.composegears.valkyrie.util.coroutines.suspendLazy import io.github.composegears.valkyrie.util.font.Woff2Decoder import io.ktor.client.HttpClient diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/domain/EvaUseCase.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/domain/EvaUseCase.kt index 429293dd6..41f158518 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/domain/EvaUseCase.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/domain/EvaUseCase.kt @@ -1,16 +1,16 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.eva.domain import io.github.composegears.valkyrie.settings.InMemorySettings -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.FontByteArray -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.Codepoint -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.StandardIconProvider -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.inferCategoryFromTags -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.toDisplayName -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIcon -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIconConfig -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.StandardIconProvider +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.Codepoint +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.inferCategoryFromTags +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.toDisplayName import io.github.composegears.valkyrie.ui.screen.webimport.standard.eva.data.EvaRepository class EvaUseCase( @@ -47,7 +47,7 @@ class EvaUseCase( override suspend fun loadFontBytes(style: IconStyle?): FontByteArray = FontByteArray(repository.loadFontBytes()) - override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings): String = repository.downloadSvg(icon.name) + override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings, style: IconStyle?): String = repository.downloadSvg(icon.name) } internal fun String.toEvaStyle(): IconStyle { diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/feather/FeatherImportScreen.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/feather/FeatherImportScreen.kt index d67988e0e..76644757d 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/feather/FeatherImportScreen.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/feather/FeatherImportScreen.kt @@ -10,7 +10,7 @@ import com.composegears.tiamat.compose.navigate import io.github.composegears.valkyrie.jewel.tooling.ProjectPreviewTheme import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionParamsSource.TextSource import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionScreen -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.StandardImportScreen +import io.github.composegears.valkyrie.ui.screen.webimport.common.StandardImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.feather.di.FeatherModule import io.github.composegears.valkyrie.util.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/feather/domain/FeatherUseCase.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/feather/domain/FeatherUseCase.kt index 5c831df38..c15976ba8 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/feather/domain/FeatherUseCase.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/feather/domain/FeatherUseCase.kt @@ -1,17 +1,17 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.feather.domain import io.github.composegears.valkyrie.settings.InMemorySettings -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.FontByteArray -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.Codepoint -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.StandardIconProvider -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.SvgSizeCustomizer -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.inferCategoryFromTags -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.toDisplayName -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIcon -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIconConfig -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.StandardIconProvider +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.Codepoint +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.inferCategoryFromTags +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.SvgSizeCustomizer +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.toDisplayName import io.github.composegears.valkyrie.ui.screen.webimport.standard.feather.data.FeatherRepository class FeatherUseCase( @@ -38,7 +38,7 @@ class FeatherUseCase( return FontByteArray(repository.loadFontBytes()) } - override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings): String { + override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings, style: IconStyle?): String { val rawSvg = repository.downloadSvg(icon.name) return SvgSizeCustomizer.applySettings(rawSvg, settings) } diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/FontAwesomeImportScreen.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/FontAwesomeImportScreen.kt index 2502c22c2..5f32a3e01 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/FontAwesomeImportScreen.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/FontAwesomeImportScreen.kt @@ -10,7 +10,7 @@ import com.composegears.tiamat.compose.navigate import io.github.composegears.valkyrie.jewel.tooling.ProjectPreviewTheme import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionParamsSource.TextSource import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionScreen -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.StandardImportScreen +import io.github.composegears.valkyrie.ui.screen.webimport.common.StandardImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.fontawesome.di.FontAwesomeModule import io.github.composegears.valkyrie.util.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/data/FontAwesomeCategoriesYamlParser.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/data/FontAwesomeCategoriesYamlParser.kt index 04ce4aafb..38c757a2d 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/data/FontAwesomeCategoriesYamlParser.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/data/FontAwesomeCategoriesYamlParser.kt @@ -1,7 +1,7 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.fontawesome.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.toDisplayName -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.toDisplayName class FontAwesomeCategoriesYamlParser { diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/data/FontAwesomeRepository.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/data/FontAwesomeRepository.kt index 8588d4e94..d8bbe58e8 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/data/FontAwesomeRepository.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/data/FontAwesomeRepository.kt @@ -1,6 +1,6 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.fontawesome.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory import io.github.composegears.valkyrie.util.coroutines.suspendLazy import io.github.composegears.valkyrie.util.font.Woff2Decoder import io.ktor.client.HttpClient diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/domain/FontAwesomeUseCase.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/domain/FontAwesomeUseCase.kt index 53194e998..a67adbbd5 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/domain/FontAwesomeUseCase.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/domain/FontAwesomeUseCase.kt @@ -2,17 +2,17 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.fontawesome import androidx.compose.ui.text.font.FontWeight import io.github.composegears.valkyrie.settings.InMemorySettings -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.FontByteArray -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.Codepoint -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.StandardIconProvider -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.SvgSizeCustomizer -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.inferCategoryFromTags -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.toDisplayName -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIcon -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIconConfig -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.StandardIconProvider +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.Codepoint +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.inferCategoryFromTags +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.SvgSizeCustomizer +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.toDisplayName import io.github.composegears.valkyrie.ui.screen.webimport.standard.fontawesome.data.FontAwesomeIconMetadata import io.github.composegears.valkyrie.ui.screen.webimport.standard.fontawesome.data.FontAwesomeRepository @@ -67,7 +67,7 @@ class FontAwesomeUseCase( return FontByteArray(repository.loadFontBytes(styleId = styleId)) } - override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings): String { + override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings, style: IconStyle?): String { val styleId = icon.style?.id ?: SOLID_STYLE_ID val rawSvg = repository.downloadSvg(iconName = icon.name, styleId = styleId) return SvgSizeCustomizer.applySettings(rawSvg, settings) diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/IoniconsImportScreen.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/IoniconsImportScreen.kt index 88f737435..c32411d6e 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/IoniconsImportScreen.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/IoniconsImportScreen.kt @@ -10,7 +10,7 @@ import com.composegears.tiamat.compose.navigate import io.github.composegears.valkyrie.jewel.tooling.ProjectPreviewTheme import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionParamsSource.TextSource import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionScreen -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.StandardImportScreen +import io.github.composegears.valkyrie.ui.screen.webimport.common.StandardImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.ionicons.di.IoniconsModule import io.github.composegears.valkyrie.util.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/domain/IoniconsIconConfigBuilder.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/domain/IoniconsIconConfigBuilder.kt index 7a9602be0..020fbb8b3 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/domain/IoniconsIconConfigBuilder.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/domain/IoniconsIconConfigBuilder.kt @@ -1,10 +1,10 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.ionicons.domain -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.Codepoint -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.inferCategoryFromTags -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.toDisplayName -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.Codepoint +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.inferCategoryFromTags +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.toDisplayName import io.github.composegears.valkyrie.ui.screen.webimport.standard.ionicons.data.IoniconsIconMetadata fun buildIonicons( diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/domain/IoniconsUseCase.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/domain/IoniconsUseCase.kt index 0339ae5ee..aa7881f68 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/domain/IoniconsUseCase.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/domain/IoniconsUseCase.kt @@ -1,14 +1,14 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.ionicons.domain import io.github.composegears.valkyrie.settings.InMemorySettings -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.FontByteArray -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.StandardIconProvider -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.SvgSizeCustomizer -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIcon -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIconConfig -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.StandardIconProvider +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.SvgSizeCustomizer import io.github.composegears.valkyrie.ui.screen.webimport.standard.ionicons.data.IoniconsRepository class IoniconsUseCase( @@ -38,7 +38,7 @@ class IoniconsUseCase( return FontByteArray(repository.loadFontBytes()) } - override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings): String { + override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings, style: IconStyle?): String { val rawSvg = repository.downloadSvg(icon.name) return SvgSizeCustomizer.applySettings(rawSvg, settings) } diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/LucideImportScreen.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/LucideImportScreen.kt index aa28b4f12..c186892da 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/LucideImportScreen.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/LucideImportScreen.kt @@ -10,7 +10,7 @@ import com.composegears.tiamat.compose.navigate import io.github.composegears.valkyrie.jewel.tooling.ProjectPreviewTheme import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionParamsSource.TextSource import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionScreen -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.StandardImportScreen +import io.github.composegears.valkyrie.ui.screen.webimport.common.StandardImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.lucide.di.LucideModule import io.github.composegears.valkyrie.util.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/data/LucideCodepointParser.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/data/LucideCodepointParser.kt index 834b24734..b93961987 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/data/LucideCodepointParser.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/data/LucideCodepointParser.kt @@ -1,6 +1,6 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.lucide.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data.RegexCssCodepointParser +import io.github.composegears.valkyrie.ui.screen.webimport.common.data.RegexCssCodepointParser class LucideCodepointParser : RegexCssCodepointParser( diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/data/LucideRepository.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/data/LucideRepository.kt index d9bac1803..838662b69 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/data/LucideRepository.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/data/LucideRepository.kt @@ -1,6 +1,6 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.lucide.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data.CodepointParser +import io.github.composegears.valkyrie.ui.screen.webimport.common.data.CodepointParser import io.github.composegears.valkyrie.util.coroutines.suspendLazy import io.github.composegears.valkyrie.util.font.Woff2Decoder import io.ktor.client.HttpClient diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/domain/LucideUseCase.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/domain/LucideUseCase.kt index 4db49169a..b93932deb 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/domain/LucideUseCase.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/lucide/domain/LucideUseCase.kt @@ -1,17 +1,17 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.lucide.domain import io.github.composegears.valkyrie.settings.InMemorySettings -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.FontByteArray -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.Codepoint -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.StandardIconProvider -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.SvgSizeCustomizer -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.inferCategoryFromTags -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.toDisplayName -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIcon -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIconConfig -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.StandardIconProvider +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.Codepoint +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.inferCategoryFromTags +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.SvgSizeCustomizer +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.toDisplayName import io.github.composegears.valkyrie.ui.screen.webimport.standard.lucide.data.LucideRepository class LucideUseCase( @@ -52,7 +52,7 @@ class LucideUseCase( return FontByteArray(repository.loadFontBytes()) } - override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings): String { + override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings, style: IconStyle?): String { val rawSvg = repository.downloadSvg(icon.name) return SvgSizeCustomizer.applySettings(rawSvg, settings) } diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/MaterialSymbolsImportScreen.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/MaterialSymbolsImportScreen.kt new file mode 100644 index 000000000..4bd43380a --- /dev/null +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/MaterialSymbolsImportScreen.kt @@ -0,0 +1,56 @@ +package io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import com.composegears.leviathan.compose.inject +import com.composegears.tiamat.compose.TiamatPreview +import com.composegears.tiamat.compose.back +import com.composegears.tiamat.compose.navController +import com.composegears.tiamat.compose.navDestination +import com.composegears.tiamat.compose.navigate +import io.github.composegears.valkyrie.jewel.tooling.ProjectPreviewTheme +import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionParamsSource.TextSource +import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionScreen +import io.github.composegears.valkyrie.ui.screen.webimport.common.StandardImportScreen +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.di.MaterialSymbolsModule +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.ui.MaterialFontCustomization +import io.github.composegears.valkyrie.util.stringResource +import org.jetbrains.compose.ui.tooling.preview.Preview + +val MaterialSymbolsImportScreen by navDestination { + val navController = navController() + val parentNavController = navController.parent + + val useCase = inject(MaterialSymbolsModule.materialSymbolsConfigUseCase) + + StandardImportScreen( + title = stringResource("web.import.title.material"), + provider = useCase, + onBack = navController::back, + onIconDownload = { event -> + parentNavController?.navigate( + dest = SimpleConversionScreen, + navArgs = TextSource( + name = event.name, + text = event.svgContent, + ), + ) + }, + customizationContent = { onClose -> + val fontSettings by useCase.fontSettingsFlow.collectAsState() + + MaterialFontCustomization( + fontSettings = fontSettings, + onClose = onClose, + onSettingsChange = useCase::updateFontSettings, + ) + }, + ) +} + +@Preview +@Composable +private fun MaterialSymbolsImportScreenPreview() = ProjectPreviewTheme { + TiamatPreview(MaterialSymbolsImportScreen) +} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/data/config/MaterialIconsMetadata.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/data/config/MaterialIconsMetadata.kt similarity index 89% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/data/config/MaterialIconsMetadata.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/data/config/MaterialIconsMetadata.kt index 28f89f779..ac30ab263 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/data/config/MaterialIconsMetadata.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/data/config/MaterialIconsMetadata.kt @@ -1,4 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material.data.config +package io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.data.config import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/data/config/MaterialSymbolsConfigRepository.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/data/config/MaterialSymbolsConfigRepository.kt similarity index 88% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/data/config/MaterialSymbolsConfigRepository.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/data/config/MaterialSymbolsConfigRepository.kt index b4b88acee..3831bfbb3 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/data/config/MaterialSymbolsConfigRepository.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/data/config/MaterialSymbolsConfigRepository.kt @@ -1,4 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material.data.config +package io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.data.config import io.ktor.client.HttpClient import io.ktor.client.request.get diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/data/font/MaterialFontRepository.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/data/font/MaterialFontRepository.kt similarity index 54% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/data/font/MaterialFontRepository.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/data/font/MaterialFontRepository.kt index 3ffd3a0c0..d07ab87ff 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/data/font/MaterialFontRepository.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/data/font/MaterialFontRepository.kt @@ -1,6 +1,8 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material.data.font +package io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.data.font -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialFontSettings +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialIconFontFamily +import io.github.composegears.valkyrie.util.coroutines.suspendLazy import io.github.composegears.valkyrie.util.font.Woff2Decoder import io.ktor.client.HttpClient import io.ktor.client.request.get @@ -14,24 +16,32 @@ import kotlinx.coroutines.withContext class MaterialFontRepository( private val httpClient: HttpClient, ) { - suspend fun downloadFont(url: String): ByteArray = withContext(Dispatchers.IO) { - val woff2Bytes = httpClient.get(url).bodyAsChannel().toByteArray() + companion object { + private const val SVG_BASE_URL = "https://fonts.gstatic.com/s/i/short-term/release" + } - Woff2Decoder.decodeBytes(woff2Bytes) ?: error("Failed to decode WOFF2 font") + private val fontBytesCache = MaterialIconFontFamily.entries.associateWith { family -> + suspendLazy { loadFontBytes(family.cdnUrl) } } + suspend fun loadFont(fontFamily: MaterialIconFontFamily): ByteArray = fontBytesCache[fontFamily]!!() + suspend fun downloadSvg( name: String, fontFamily: String, fontSettings: MaterialFontSettings, ): String = withContext(Dispatchers.IO) { - val iconOption = fontSettings.iconOption() - val iconSize = fontSettings.iconSize() - val url = "https://fonts.gstatic.com/s/i/short-term/release/$fontFamily/$name/$iconOption/$iconSize.svg" - + val url = "$SVG_BASE_URL/$fontFamily/$name/${fontSettings.iconOption()}/${fontSettings.iconSize()}.svg" httpClient.get(url).bodyAsText() } + private suspend fun loadFontBytes(url: String): ByteArray = withContext(Dispatchers.IO) { + val woff2Bytes = httpClient.get(url).bodyAsChannel().toByteArray() + withContext(Dispatchers.Default) { + Woff2Decoder.decodeBytes(woff2Bytes) ?: error("Failed to decode WOFF2 font: $url") + } + } + private fun MaterialFontSettings.iconOption(): String { if (!isModified) { return "default" diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/di/MaterialSymbolsModule.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/di/MaterialSymbolsModule.kt new file mode 100644 index 000000000..1530ea5a9 --- /dev/null +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/di/MaterialSymbolsModule.kt @@ -0,0 +1,31 @@ +package io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.di + +import com.composegears.leviathan.Leviathan +import io.github.composegears.valkyrie.ui.di.coreModule +import io.github.composegears.valkyrie.ui.screen.webimport.common.di.NetworkModule +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.data.config.MaterialSymbolsConfigRepository +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.data.font.MaterialFontRepository +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.MaterialSymbolsConfigUseCase + +object MaterialSymbolsModule : Leviathan() { + private val network = NetworkModule + private val core = coreModule() + + private val materialSymbolsConfigRepository by instanceOf { + MaterialSymbolsConfigRepository( + httpClient = inject(network.httpClient), + json = inject(network.json), + ) + } + private val materialFontRepository by instanceOf { + MaterialFontRepository(httpClient = inject(NetworkModule.httpClient)) + } + + val materialSymbolsConfigUseCase by instanceOf(keepAlive = true) { + MaterialSymbolsConfigUseCase( + configRepository = inject(materialSymbolsConfigRepository), + fontRepository = inject(materialFontRepository), + inMemorySettings = inject(core.inMemorySettings), + ) + } +} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/domain/MaterialSymbolsConfigUseCase.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/domain/MaterialSymbolsConfigUseCase.kt new file mode 100644 index 000000000..3c0066230 --- /dev/null +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/domain/MaterialSymbolsConfigUseCase.kt @@ -0,0 +1,160 @@ +package io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain + +import androidx.compose.ui.text.font.FontVariation +import androidx.compose.ui.text.font.FontVariation.grade +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.TextUnit +import androidx.compose.ui.unit.TextUnitType +import io.github.composegears.valkyrie.parser.unified.ext.capitalized +import io.github.composegears.valkyrie.settings.InMemorySettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.StandardIconProvider +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.Codepoint +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.VariableFontConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.data.config.MaterialSymbolsConfigRepository +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.data.font.MaterialFontRepository +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialFontSettings +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialIconFontFamily +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow + +class MaterialSymbolsConfigUseCase( + private val configRepository: MaterialSymbolsConfigRepository, + private val fontRepository: MaterialFontRepository, + private val inMemorySettings: InMemorySettings, +) : StandardIconProvider { + + private val _fontSettingsFlow = MutableStateFlow( + inMemorySettings.readState { + MaterialFontSettings( + fill = materialFontFill, + weight = materialFontWeight, + grade = materialFontGrade, + opticalSize = materialFontOpticalSize, + ) + }, + ) + val fontSettingsFlow = _fontSettingsFlow.asStateFlow() + + private val _variableFontConfig = MutableStateFlow( + _fontSettingsFlow.value.toVariableFontConfig(), + ) + + override val providerName: String = "Material Symbols" + override val stateKey: String = "material_symbols" + override val fontAlias: String = "materialsymbols" + override val persistentSize: Int = SizeSettings.DEFAULT_SIZE + override val variableFontConfig = _variableFontConfig.asStateFlow() + + override fun resolveFontWeight(style: IconStyle?) = FontWeight(_fontSettingsFlow.value.weight) + + override suspend fun loadConfig(): StandardIconConfig { + val result = configRepository.load() + + // Filter only Material Symbols icons (exclude older Material Icons families) + val filteredIcons = result.icons.filterNot { icon -> + icon.unsupportedFamilies.any { it.startsWith("Material Icons") } + } + + val categories = filteredIcons + .flatMap { it.categories } + .distinct() + .sorted() + .map { InferredCategory(id = it.lowercase().replace(" ", "_"), name = it.toCategoryName()) } + + val icons = filteredIcons.map { icon -> + StandardIcon( + name = icon.name, + displayName = icon.name.toIconName(), + exportName = icon.name.toIconName(), + codepoint = Codepoint(icon.codepoint), + tags = emptyList(), + category = InferredCategory( + id = (icon.categories.firstOrNull() ?: "uncategorized").lowercase().replace(" ", "_"), + name = (icon.categories.firstOrNull() ?: "uncategorized").toCategoryName(), + ), + style = null, + ) + } + + val allCategory = InferredCategory(id = "all", name = "All") + val groupedIcons = icons.groupBy { it.category } + val styles = MaterialIconFontFamily.entries.map { it.toIconStyle() } + + return StandardIconConfig( + gridItems = groupedIcons, + categories = listOf(allCategory) + categories, + styles = styles, + ) + } + + override suspend fun loadFontBytes(style: IconStyle?): FontByteArray { + val fontFamily = FAMILY_BY_STYLE_ID[style?.id] ?: MaterialIconFontFamily.Outlined + return FontByteArray(bytes = fontRepository.loadFont(fontFamily)) + } + + override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings, style: IconStyle?): String { + val fontFamily = FAMILY_BY_STYLE_ID[style?.id] ?: MaterialIconFontFamily.Outlined + + return fontRepository.downloadSvg( + name = icon.name, + fontFamily = fontFamily.fontFamily, + fontSettings = _fontSettingsFlow.value, + ) + } + + fun updateFontSettings(settings: MaterialFontSettings) { + _fontSettingsFlow.value = settings + _variableFontConfig.value = settings.toVariableFontConfig() + inMemorySettings.update { + materialFontFill = settings.fill + materialFontWeight = settings.weight + materialFontGrade = settings.grade + materialFontOpticalSize = settings.opticalSize + } + } + + private fun MaterialFontSettings.toVariableFontConfig() = VariableFontConfig( + variation = FontVariation.Settings( + FontVariation.Setting("FILL", if (fill) 1f else 0f), + grade(grade), + FontVariation.opticalSizing(TextUnit(opticalSize, TextUnitType.Sp)), + ), + weights = MATERIAL_FONT_WEIGHTS, + weight = FontWeight(weight), + opticalSize = opticalSize, + ) + + private fun MaterialIconFontFamily.toIconStyle() = IconStyle( + id = name.lowercase(), + name = displayName, + ) + + companion object { + private val MATERIAL_FONT_WEIGHTS = listOf( + FontWeight.W100, + FontWeight.W200, + FontWeight.W300, + FontWeight.W400, + FontWeight.W500, + FontWeight.W600, + FontWeight.W700, + ) + + private val FAMILY_BY_STYLE_ID = MaterialIconFontFamily.entries.associateBy { it.name.lowercase() } + } +} + +private fun String.toIconName(): String = replace('_', ' ') + .split(' ') + .joinToString(" ") { it.capitalized() } + +private fun String.toCategoryName(): String = when (lowercase()) { + "av" -> "Audio & Video" + else -> capitalized() +} diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/model/font/MaterialFontSettings.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/domain/model/MaterialFontSettings.kt similarity index 87% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/model/font/MaterialFontSettings.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/domain/model/MaterialFontSettings.kt index b1afedd40..973c491f1 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/model/font/MaterialFontSettings.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/domain/model/MaterialFontSettings.kt @@ -1,6 +1,6 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font +package io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.IconSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.IconSettings data class MaterialFontSettings( val fill: Boolean = DEFAULT_FILL, diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/model/font/MaterialIconFontFamily.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/domain/model/MaterialIconFontFamily.kt similarity index 90% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/model/font/MaterialIconFontFamily.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/domain/model/MaterialIconFontFamily.kt index 9ff9e4f03..43dad689e 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/domain/model/font/MaterialIconFontFamily.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/domain/model/MaterialIconFontFamily.kt @@ -1,4 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font +package io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model enum class MaterialIconFontFamily( val cdnUrl: String, diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/ui/MaterialFontCustomization.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/ui/MaterialFontCustomization.kt similarity index 96% rename from tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/ui/MaterialFontCustomization.kt rename to tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/ui/MaterialFontCustomization.kt index 6c9f491c8..0d86784a6 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/material/ui/MaterialFontCustomization.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/materialsymbols/ui/MaterialFontCustomization.kt @@ -1,4 +1,4 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.material.ui +package io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.ui import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column @@ -23,7 +23,7 @@ import io.github.composegears.valkyrie.sdk.compose.foundation.layout.CenterVerti import io.github.composegears.valkyrie.sdk.compose.foundation.layout.Spacer import io.github.composegears.valkyrie.sdk.compose.foundation.rememberMutableState import io.github.composegears.valkyrie.ui.screen.webimport.common.ui.CustomizationToolbar -import io.github.composegears.valkyrie.ui.screen.webimport.material.domain.model.font.MaterialFontSettings +import io.github.composegears.valkyrie.ui.screen.webimport.standard.materialsymbols.domain.model.MaterialFontSettings import io.github.composegears.valkyrie.util.ValkyrieBundle.message import io.github.composegears.valkyrie.util.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview @@ -143,6 +143,7 @@ private fun FontPlayground( url = OPTICAL_SIZE_HELP_URL, ) } + Spacer(16.dp) } } } diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/RemixImportScreen.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/RemixImportScreen.kt index 2f7d29ba8..cf617fc62 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/RemixImportScreen.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/RemixImportScreen.kt @@ -10,7 +10,7 @@ import com.composegears.tiamat.compose.navigate import io.github.composegears.valkyrie.jewel.tooling.ProjectPreviewTheme import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionParamsSource.TextSource import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionScreen -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.StandardImportScreen +import io.github.composegears.valkyrie.ui.screen.webimport.common.StandardImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.remix.di.RemixModule import io.github.composegears.valkyrie.util.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/data/RemixCodepointParser.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/data/RemixCodepointParser.kt index f6c6533f0..0172f654f 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/data/RemixCodepointParser.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/data/RemixCodepointParser.kt @@ -1,6 +1,6 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.remix.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data.RegexCssCodepointParser +import io.github.composegears.valkyrie.ui.screen.webimport.common.data.RegexCssCodepointParser class RemixCodepointParser : RegexCssCodepointParser( diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/data/RemixRepository.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/data/RemixRepository.kt index ef55c4a1a..ae400c78b 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/data/RemixRepository.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/data/RemixRepository.kt @@ -1,6 +1,6 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.remix.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data.CodepointParser +import io.github.composegears.valkyrie.ui.screen.webimport.common.data.CodepointParser import io.github.composegears.valkyrie.util.coroutines.suspendLazy import io.github.composegears.valkyrie.util.font.Woff2Decoder import io.ktor.client.HttpClient diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/domain/RemixUseCase.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/domain/RemixUseCase.kt index 01d708b31..12c8925cd 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/domain/RemixUseCase.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/remix/domain/RemixUseCase.kt @@ -1,18 +1,18 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.remix.domain import io.github.composegears.valkyrie.settings.InMemorySettings -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.FontByteArray -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.Codepoint -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.StandardIconProvider -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.SvgSizeCustomizer -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.inferCategoryFromTags -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.toDisplayName -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.InferredCategory -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIcon -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIconConfig -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.StandardIconProvider +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.Codepoint +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.inferCategoryFromTags +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.SvgSizeCustomizer +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.toDisplayName import io.github.composegears.valkyrie.ui.screen.webimport.standard.remix.data.RemixRepository class RemixUseCase( @@ -61,7 +61,7 @@ class RemixUseCase( return FontByteArray(repository.loadFontBytes()) } - override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings): String { + override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings, style: IconStyle?): String { val rawSvg = repository.downloadSvg(icon.name) return SvgSizeCustomizer.applySettings(rawSvg, settings) } diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/TablerImportScreen.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/TablerImportScreen.kt index 9f246621e..669e6aa50 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/TablerImportScreen.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/TablerImportScreen.kt @@ -10,7 +10,7 @@ import com.composegears.tiamat.compose.navigate import io.github.composegears.valkyrie.jewel.tooling.ProjectPreviewTheme import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionParamsSource.TextSource import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleConversionScreen -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.StandardImportScreen +import io.github.composegears.valkyrie.ui.screen.webimport.common.StandardImportScreen import io.github.composegears.valkyrie.ui.screen.webimport.standard.tabler.di.TablerModule import io.github.composegears.valkyrie.util.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerCodepointParser.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerCodepointParser.kt index e8e769c32..d00409e5b 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerCodepointParser.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerCodepointParser.kt @@ -1,6 +1,6 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.tabler.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data.RegexCssCodepointParser +import io.github.composegears.valkyrie.ui.screen.webimport.common.data.RegexCssCodepointParser class TablerCodepointParser : RegexCssCodepointParser( diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerRepository.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerRepository.kt index 6fc2146e8..8cb2fc76b 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerRepository.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerRepository.kt @@ -1,7 +1,7 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.tabler.data -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.data.CodepointParser -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.data.CodepointParser +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle import io.github.composegears.valkyrie.ui.screen.webimport.standard.tabler.domain.TABLER_FILLED_STYLE import io.github.composegears.valkyrie.util.coroutines.suspendLazy import io.github.composegears.valkyrie.util.font.Woff2Decoder diff --git a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/domain/TablerUseCase.kt b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/domain/TablerUseCase.kt index 0a4d65566..8733ae47f 100644 --- a/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/domain/TablerUseCase.kt +++ b/tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/domain/TablerUseCase.kt @@ -1,16 +1,16 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.tabler.domain import io.github.composegears.valkyrie.settings.InMemorySettings -import io.github.composegears.valkyrie.ui.screen.webimport.common.model.FontByteArray -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.Codepoint -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.StandardIconProvider -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.inferCategoryFromTags -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain.toDisplayName -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.SizeSettings -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIcon -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.StandardIconConfig -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.StandardIconProvider +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.Codepoint +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.FontByteArray +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIcon +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.StandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.toStandardIconConfig +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.inferCategoryFromTags +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.settings.SizeSettings +import io.github.composegears.valkyrie.ui.screen.webimport.common.util.toDisplayName import io.github.composegears.valkyrie.ui.screen.webimport.standard.tabler.data.TablerRepository internal val TABLER_OUTLINE_STYLE = IconStyle(id = "outline", name = "Outline") @@ -42,7 +42,7 @@ class TablerUseCase( override suspend fun loadFontBytes(style: IconStyle?): FontByteArray = FontByteArray(repository.loadFontBytes(style)) - override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings): String = repository.downloadSvg( + override suspend fun downloadSvg(icon: StandardIcon, settings: SizeSettings, style: IconStyle?): String = repository.downloadSvg( iconName = icon.name, style = icon.style ?: TABLER_OUTLINE_STYLE, ) diff --git a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/CodepointGlyphTest.kt b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/CodepointGlyphTest.kt similarity index 82% rename from tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/CodepointGlyphTest.kt rename to tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/CodepointGlyphTest.kt index 7a4deb2e5..c039ca8ca 100644 --- a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/common/domain/CodepointGlyphTest.kt +++ b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/domain/CodepointGlyphTest.kt @@ -1,9 +1,10 @@ -package io.github.composegears.valkyrie.ui.screen.webimport.standard.common.domain +package io.github.composegears.valkyrie.ui.screen.webimport.common.domain import assertk.assertFailure import assertk.assertThat import assertk.assertions.isEqualTo import assertk.assertions.isInstanceOf +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.font.Codepoint import org.junit.jupiter.api.Test class CodepointGlyphTest { diff --git a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/domain/EvaIconNameTest.kt b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/domain/EvaIconNameTest.kt index 0b69ec566..758b1c4e1 100644 --- a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/domain/EvaIconNameTest.kt +++ b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/eva/domain/EvaIconNameTest.kt @@ -2,7 +2,7 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.eva.domain import assertk.assertThat import assertk.assertions.isEqualTo -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle import org.junit.jupiter.api.Test class EvaIconNameTest { diff --git a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/feather/domain/FeatherIconConfigBuilderTest.kt b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/feather/domain/FeatherIconConfigBuilderTest.kt index f9f97d367..a61b76fb5 100644 --- a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/feather/domain/FeatherIconConfigBuilderTest.kt +++ b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/feather/domain/FeatherIconConfigBuilderTest.kt @@ -4,7 +4,7 @@ import assertk.assertThat import assertk.assertions.containsExactly import assertk.assertions.hasSize import assertk.assertions.isEqualTo -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory import org.junit.jupiter.api.Test class FeatherIconConfigBuilderTest { diff --git a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/data/FontAwesomeCategoriesYamlParserTest.kt b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/data/FontAwesomeCategoriesYamlParserTest.kt index 35e6a4848..9057ef7d5 100644 --- a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/data/FontAwesomeCategoriesYamlParserTest.kt +++ b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/fontawesome/data/FontAwesomeCategoriesYamlParserTest.kt @@ -2,7 +2,7 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.fontawesome import assertk.assertThat import assertk.assertions.isEqualTo -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory import org.junit.jupiter.api.Test class FontAwesomeCategoriesYamlParserTest { diff --git a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/domain/IoniconsIconConfigBuilderTest.kt b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/domain/IoniconsIconConfigBuilderTest.kt index b6dc96600..a659097d3 100644 --- a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/domain/IoniconsIconConfigBuilderTest.kt +++ b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/ionicons/domain/IoniconsIconConfigBuilderTest.kt @@ -4,8 +4,8 @@ import assertk.assertThat import assertk.assertions.containsExactly import assertk.assertions.hasSize import assertk.assertions.isEqualTo -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.category.InferredCategory +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle import io.github.composegears.valkyrie.ui.screen.webimport.standard.ionicons.data.IoniconsIconMetadata import org.junit.jupiter.api.Test diff --git a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerSvgPathResolverTest.kt b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerSvgPathResolverTest.kt index 98b1d936d..c7d70d833 100644 --- a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerSvgPathResolverTest.kt +++ b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/data/TablerSvgPathResolverTest.kt @@ -2,7 +2,7 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.tabler.data import assertk.assertThat import assertk.assertions.isEqualTo -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle import org.junit.jupiter.api.Test class TablerSvgPathResolverTest { diff --git a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/domain/TablerIconConfigBuilderTest.kt b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/domain/TablerIconConfigBuilderTest.kt index d229d74d0..a0636bca9 100644 --- a/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/domain/TablerIconConfigBuilderTest.kt +++ b/tools/idea-plugin/src/test/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/standard/tabler/domain/TablerIconConfigBuilderTest.kt @@ -3,7 +3,7 @@ package io.github.composegears.valkyrie.ui.screen.webimport.standard.tabler.doma import assertk.assertThat import assertk.assertions.containsExactly import assertk.assertions.hasSize -import io.github.composegears.valkyrie.ui.screen.webimport.standard.common.model.IconStyle +import io.github.composegears.valkyrie.ui.screen.webimport.common.domain.icon.IconStyle import org.junit.jupiter.api.Test class TablerIconConfigBuilderTest {