From e8c75b23aa450dfa0168383264fb00c141b85cfe Mon Sep 17 00:00:00 2001 From: Ryo Takeuchi Date: Thu, 23 Nov 2023 11:35:51 +0900 Subject: [PATCH 1/3] =?UTF-8?q?:recycle:=20settings=20=E3=83=A2=E3=82=B8?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=83=AB=E3=81=AB=20explicitApi=20=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/settings/build.gradle.kts | 2 ++ .../nito/feature/settings/SettingsNavigation.kt | 6 +++--- .../club/nito/feature/settings/SettingsScreen.kt | 2 +- .../nito/feature/settings/SettingsScreenEvent.kt | 4 ++-- .../nito/feature/settings/SettingsScreenIntent.kt | 12 ++++++------ .../feature/settings/SettingsScreenStateMachine.kt | 12 ++++++------ .../nito/feature/settings/SettingsScreenUiState.kt | 14 +++++++------- .../feature/settings/di/SettingsFeatureModule.kt | 2 +- 8 files changed, 28 insertions(+), 26 deletions(-) diff --git a/feature/settings/build.gradle.kts b/feature/settings/build.gradle.kts index a78c85ef..79882545 100644 --- a/feature/settings/build.gradle.kts +++ b/feature/settings/build.gradle.kts @@ -8,6 +8,8 @@ plugins { android.namespace = "club.nito.feature.settings" kotlin { + explicitApi() + sourceSets { commonMain { dependencies { diff --git a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsNavigation.kt b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsNavigation.kt index 1d6cf404..2c897793 100644 --- a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsNavigation.kt +++ b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsNavigation.kt @@ -4,13 +4,13 @@ import moe.tlaster.precompose.navigation.NavOptions import moe.tlaster.precompose.navigation.Navigator import moe.tlaster.precompose.navigation.RouteBuilder -const val settingsNavigationRoute = "settings_route" +public const val settingsNavigationRoute: String = "settings_route" -fun Navigator.navigateToSettings(navOptions: NavOptions? = null) { +public fun Navigator.navigateToSettings(navOptions: NavOptions? = null) { this.navigate(settingsNavigationRoute, navOptions) } -fun RouteBuilder.settingsScreen( +public fun RouteBuilder.settingsScreen( onSignedOut: () -> Unit = {}, ) { scene( diff --git a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreen.kt b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreen.kt index 7ef78a46..21a6437c 100644 --- a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreen.kt +++ b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreen.kt @@ -30,7 +30,7 @@ import club.nito.core.ui.message.SnackbarMessageEffect import club.nito.feature.settings.component.ModifyPasswordDialog @Composable -fun SettingsRoute( +public fun SettingsRoute( stateMachine: SettingsScreenStateMachine = koinStateMachine(), onSignedOut: () -> Unit = {}, ) { diff --git a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenEvent.kt b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenEvent.kt index 5fd34b0d..11f8dc72 100644 --- a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenEvent.kt +++ b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenEvent.kt @@ -1,5 +1,5 @@ package club.nito.feature.settings -sealed class SettingsScreenEvent { - data object SignedOut : SettingsScreenEvent() +public sealed class SettingsScreenEvent { + public data object SignedOut : SettingsScreenEvent() } diff --git a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenIntent.kt b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenIntent.kt index d686a9d3..ba6ddca9 100644 --- a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenIntent.kt +++ b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenIntent.kt @@ -1,9 +1,9 @@ package club.nito.feature.settings -sealed class SettingsScreenIntent { - data object ClickShowModifyPasswordDialog : SettingsScreenIntent() - data class ChangeNewPasswordValue(val newValue: String) : SettingsScreenIntent() - data object ClickModifyPassword : SettingsScreenIntent() - data object ClickDismissModifyPasswordDialog : SettingsScreenIntent() - data object ClickSignOut : SettingsScreenIntent() +public sealed class SettingsScreenIntent { + public data object ClickShowModifyPasswordDialog : SettingsScreenIntent() + public data class ChangeNewPasswordValue(val newValue: String) : SettingsScreenIntent() + public data object ClickModifyPassword : SettingsScreenIntent() + public data object ClickDismissModifyPasswordDialog : SettingsScreenIntent() + public data object ClickSignOut : SettingsScreenIntent() } diff --git a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenStateMachine.kt b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenStateMachine.kt index 53fbca77..f7ff5880 100644 --- a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenStateMachine.kt +++ b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenStateMachine.kt @@ -20,11 +20,11 @@ import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch import moe.tlaster.precompose.viewmodel.viewModelScope -class SettingsScreenStateMachine( +public class SettingsScreenStateMachine( observeAuthStatus: ObserveAuthStatusUseCase, private val modifyPassword: ModifyPasswordUseCase, private val signOut: SignOutUseCase, - val userMessageStateHolder: UserMessageStateHolder, + public val userMessageStateHolder: UserMessageStateHolder, ) : StateMachine(), UserMessageStateHolder by userMessageStateHolder { @@ -38,7 +38,7 @@ class SettingsScreenStateMachine( private val newPassword = MutableStateFlow("") private val isPasswordModifying = MutableStateFlow(false) - val uiState: StateFlow = buildUiState( + public val uiState: StateFlow = buildUiState( authStatus, showModifyPasswordDialog, newPassword, @@ -57,7 +57,7 @@ class SettingsScreenStateMachine( } private val _events = MutableStateFlow>(emptyList()) - val event: Flow = _events.map { it.firstOrNull() } + public val event: Flow = _events.map { it.firstOrNull() } init { viewModelScope.launch { @@ -69,7 +69,7 @@ class SettingsScreenStateMachine( } } - fun dispatch(intent: SettingsScreenIntent) { + public fun dispatch(intent: SettingsScreenIntent) { viewModelScope.launch { when (intent) { SettingsScreenIntent.ClickShowModifyPasswordDialog -> showModifyPasswordDialog.emit(true) @@ -98,7 +98,7 @@ class SettingsScreenStateMachine( } } - fun consume(event: SettingsScreenEvent) { + public fun consume(event: SettingsScreenEvent) { viewModelScope.launch { _events.emit(_events.value.filterNot { it == event }) } diff --git a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenUiState.kt b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenUiState.kt index cfa6d589..6353c7e3 100644 --- a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenUiState.kt +++ b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/SettingsScreenUiState.kt @@ -1,6 +1,6 @@ package club.nito.feature.settings -data class SettingsScreenUiState( +public data class SettingsScreenUiState( val isSignOuting: Boolean, val modifyPassword: ModifyPasswordUiState, ) { @@ -8,12 +8,12 @@ data class SettingsScreenUiState( get() = !isSignOuting } -sealed class ModifyPasswordUiState { - data object Idle : ModifyPasswordUiState() - sealed class Show : ModifyPasswordUiState() { - abstract val newPassword: String +public sealed class ModifyPasswordUiState { + public data object Idle : ModifyPasswordUiState() + public sealed class Show : ModifyPasswordUiState() { + public abstract val newPassword: String - data class Input(override val newPassword: String) : Show() - data class Modifying(override val newPassword: String) : Show() + public data class Input(override val newPassword: String) : Show() + public data class Modifying(override val newPassword: String) : Show() } } diff --git a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/di/SettingsFeatureModule.kt b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/di/SettingsFeatureModule.kt index cdc0e396..18af63fe 100644 --- a/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/di/SettingsFeatureModule.kt +++ b/feature/settings/src/commonMain/kotlin/club/nito/feature/settings/di/SettingsFeatureModule.kt @@ -4,7 +4,7 @@ import club.nito.feature.settings.SettingsScreenStateMachine import org.koin.core.module.Module import org.koin.dsl.module -val settingsFeatureModule: Module = module { +public val settingsFeatureModule: Module = module { factory { SettingsScreenStateMachine( observeAuthStatus = get(), From 06dc4265b61fd5d03a63fed04d56698e2788705e Mon Sep 17 00:00:00 2001 From: Ryo Takeuchi Date: Thu, 23 Nov 2023 11:39:17 +0900 Subject: [PATCH 2/3] =?UTF-8?q?:recycle:=20schedule=20=E3=83=A2=E3=82=B8?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=83=AB=E3=81=AB=20explicitApi=20=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/schedule/build.gradle.kts | 2 ++ .../feature/schedule/ScheduleListEvent.kt | 4 ++-- .../feature/schedule/ScheduleListIntent.kt | 8 +++---- .../schedule/ScheduleListScreenUiState.kt | 8 +++---- .../feature/schedule/ScheduleListViewModel.kt | 21 ++++++++++++------- .../feature/schedule/ScheduleNavigation.kt | 6 +++--- .../nito/feature/schedule/ScheduleScreen.kt | 2 +- .../schedule/di/ScheduleFeatureModule.kt | 2 +- 8 files changed, 30 insertions(+), 23 deletions(-) diff --git a/feature/schedule/build.gradle.kts b/feature/schedule/build.gradle.kts index a8962e7b..4b6835e7 100644 --- a/feature/schedule/build.gradle.kts +++ b/feature/schedule/build.gradle.kts @@ -8,6 +8,8 @@ plugins { android.namespace = "club.nito.feature.schedule" kotlin { + explicitApi() + sourceSets { commonMain { dependencies { diff --git a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListEvent.kt b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListEvent.kt index aea4d703..056601aa 100644 --- a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListEvent.kt +++ b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListEvent.kt @@ -1,5 +1,5 @@ package club.nito.feature.schedule -sealed class ScheduleListEvent { - data class NavigateToScheduleDetail(val scheduleId: String) : ScheduleListEvent() +public sealed class ScheduleListEvent { + public data class NavigateToScheduleDetail(val scheduleId: String) : ScheduleListEvent() } diff --git a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListIntent.kt b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListIntent.kt index eae9d826..abdd113a 100644 --- a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListIntent.kt +++ b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListIntent.kt @@ -2,8 +2,8 @@ package club.nito.feature.schedule import club.nito.core.domain.model.ParticipantSchedule -sealed class ScheduleListIntent { - data class ClickShowConfirmParticipateDialog(val schedule: ParticipantSchedule) : ScheduleListIntent() - data class ClickParticipateSchedule(val schedule: ParticipantSchedule) : ScheduleListIntent() - data object ClickDismissConfirmParticipateDialog : ScheduleListIntent() +public sealed class ScheduleListIntent { + public data class ClickShowConfirmParticipateDialog(val schedule: ParticipantSchedule) : ScheduleListIntent() + public data class ClickParticipateSchedule(val schedule: ParticipantSchedule) : ScheduleListIntent() + public data object ClickDismissConfirmParticipateDialog : ScheduleListIntent() } diff --git a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListScreenUiState.kt b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListScreenUiState.kt index 5c450f36..28244bed 100644 --- a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListScreenUiState.kt +++ b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListScreenUiState.kt @@ -4,13 +4,13 @@ import club.nito.core.common.NitoDateTimeFormatter import club.nito.core.domain.model.ParticipantSchedule import club.nito.core.model.FetchMultipleContentResult -data class ScheduleListScreenUiState( +public data class ScheduleListScreenUiState( val dateTimeFormatter: NitoDateTimeFormatter, val scheduleList: FetchMultipleContentResult, val confirmParticipateDialog: ConfirmParticipateDialogUiState, ) -sealed class ConfirmParticipateDialogUiState { - data class Show(val schedule: ParticipantSchedule) : ConfirmParticipateDialogUiState() - data object Hide : ConfirmParticipateDialogUiState() +public sealed class ConfirmParticipateDialogUiState { + public data class Show(val schedule: ParticipantSchedule) : ConfirmParticipateDialogUiState() + public data object Hide : ConfirmParticipateDialogUiState() } diff --git a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListViewModel.kt b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListViewModel.kt index 48ef5fb9..a13c3187 100644 --- a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListViewModel.kt +++ b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleListViewModel.kt @@ -16,9 +16,9 @@ import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch import moe.tlaster.precompose.viewmodel.viewModelScope -class ScheduleListViewModel internal constructor( +public class ScheduleListViewModel internal constructor( getParticipantScheduleListUseCase: GetParticipantScheduleListUseCase, - val userMessageStateHolder: UserMessageStateHolder, + public val userMessageStateHolder: UserMessageStateHolder, private val dateTimeFormatter: NitoDateTimeFormatter, ) : StateMachine(), UserMessageStateHolder by userMessageStateHolder { @@ -30,7 +30,7 @@ class ScheduleListViewModel internal constructor( initialValue = FetchMultipleContentResult.Loading, ) - val uiState: StateFlow = buildUiState( + public val uiState: StateFlow = buildUiState( showConfirmParticipateSchedule, scheduleList, ) { showConfirmParticipateSchedule, scheduleList -> @@ -44,12 +44,15 @@ class ScheduleListViewModel internal constructor( } private val _events = MutableStateFlow>(emptyList()) - val event: Flow = _events.map { it.firstOrNull() } + public val event: Flow = _events.map { it.firstOrNull() } - fun dispatch(intent: ScheduleListIntent) { + public fun dispatch(intent: ScheduleListIntent) { viewModelScope.launch { when (intent) { - is ScheduleListIntent.ClickShowConfirmParticipateDialog -> showConfirmParticipateSchedule.emit(intent.schedule) + is ScheduleListIntent.ClickShowConfirmParticipateDialog -> { + showConfirmParticipateSchedule.emit(intent.schedule) + } + is ScheduleListIntent.ClickParticipateSchedule -> { showConfirmParticipateSchedule.emit(null) @@ -57,12 +60,14 @@ class ScheduleListViewModel internal constructor( userMessageStateHolder.showMessage("$scheduledAt に参加登録しました 🎉") } - ScheduleListIntent.ClickDismissConfirmParticipateDialog -> showConfirmParticipateSchedule.emit(null) + ScheduleListIntent.ClickDismissConfirmParticipateDialog -> { + showConfirmParticipateSchedule.emit(null) + } } } } - fun consume(event: ScheduleListEvent) { + public fun consume(event: ScheduleListEvent) { viewModelScope.launch { _events.emit(_events.value.filterNot { it == event }) } diff --git a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleNavigation.kt b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleNavigation.kt index ba05c906..896e4e28 100644 --- a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleNavigation.kt +++ b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleNavigation.kt @@ -4,13 +4,13 @@ import moe.tlaster.precompose.navigation.NavOptions import moe.tlaster.precompose.navigation.Navigator import moe.tlaster.precompose.navigation.RouteBuilder -const val scheduleNavigationRoute = "schedule_route" +public const val scheduleNavigationRoute: String = "schedule_route" -fun Navigator.navigateToSchedule(navOptions: NavOptions? = null) { +public fun Navigator.navigateToSchedule(navOptions: NavOptions? = null) { this.navigate(scheduleNavigationRoute, navOptions) } -fun RouteBuilder.scheduleScreen() { +public fun RouteBuilder.scheduleScreen() { scene( route = scheduleNavigationRoute, ) { diff --git a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleScreen.kt b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleScreen.kt index 60f5c24f..2f36ef0c 100644 --- a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleScreen.kt +++ b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/ScheduleScreen.kt @@ -21,7 +21,7 @@ import club.nito.core.ui.message.SnackbarMessageEffect import club.nito.feature.schedule.component.ScheduleListSection @Composable -fun ScheduleRoute( +public fun ScheduleRoute( viewModel: ScheduleListViewModel = koinStateMachine(), ) { viewModel.event.collectAsState(initial = null).value?.let { diff --git a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/di/ScheduleFeatureModule.kt b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/di/ScheduleFeatureModule.kt index f40c112a..09c0b65c 100644 --- a/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/di/ScheduleFeatureModule.kt +++ b/feature/schedule/src/commonMain/kotlin/club/nito/feature/schedule/di/ScheduleFeatureModule.kt @@ -4,7 +4,7 @@ import club.nito.feature.schedule.ScheduleListViewModel import org.koin.core.module.Module import org.koin.dsl.module -val scheduleFeatureModule: Module = module { +public val scheduleFeatureModule: Module = module { factory { ScheduleListViewModel( getParticipantScheduleListUseCase = get(), From 4346f656b80b20a7084cddec31e8f379c396ac63 Mon Sep 17 00:00:00 2001 From: Ryo Takeuchi Date: Thu, 23 Nov 2023 11:43:02 +0900 Subject: [PATCH 3/3] =?UTF-8?q?:recycle:=20auth=20=E3=83=A2=E3=82=B8?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=83=AB=E3=81=AB=20explicitApi=20=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/auth/build.gradle.kts | 2 ++ .../kotlin/club/nito/feature/auth/LoginNavigation.kt | 6 +++--- .../kotlin/club/nito/feature/auth/LoginScreen.kt | 2 +- .../club/nito/feature/auth/LoginScreenEvent.kt | 6 +++--- .../club/nito/feature/auth/LoginScreenIntent.kt | 10 +++++----- .../nito/feature/auth/LoginScreenStateMachine.kt | 12 ++++++------ .../club/nito/feature/auth/LoginScreenUiState.kt | 2 +- .../club/nito/feature/auth/di/AuthFeatureModule.kt | 2 +- 8 files changed, 22 insertions(+), 20 deletions(-) diff --git a/feature/auth/build.gradle.kts b/feature/auth/build.gradle.kts index df3fd8f6..ffe9c2c5 100644 --- a/feature/auth/build.gradle.kts +++ b/feature/auth/build.gradle.kts @@ -8,6 +8,8 @@ plugins { android.namespace = "club.nito.feature.auth" kotlin { + explicitApi() + sourceSets { commonMain { dependencies { diff --git a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginNavigation.kt b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginNavigation.kt index b0bcd080..4513e738 100644 --- a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginNavigation.kt +++ b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginNavigation.kt @@ -4,13 +4,13 @@ import moe.tlaster.precompose.navigation.NavOptions import moe.tlaster.precompose.navigation.Navigator import moe.tlaster.precompose.navigation.RouteBuilder -const val loginNavigationRoute = "login_route" +public const val loginNavigationRoute: String = "login_route" -fun Navigator.navigateToLogin(navOptions: NavOptions? = null) { +public fun Navigator.navigateToLogin(navOptions: NavOptions? = null) { this.navigate(loginNavigationRoute, navOptions) } -fun RouteBuilder.loginScreen( +public fun RouteBuilder.loginScreen( onLoggedIn: () -> Unit = {}, onRegisterClick: () -> Unit = {}, ) { diff --git a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreen.kt b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreen.kt index 68d7a96c..103aea80 100644 --- a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreen.kt +++ b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreen.kt @@ -27,7 +27,7 @@ import club.nito.core.ui.koinStateMachine import club.nito.core.ui.message.SnackbarMessageEffect @Composable -fun LoginRoute( +public fun LoginRoute( viewModel: LoginScreenStateMachine = koinStateMachine(), onLoggedIn: () -> Unit = {}, onRegisterClick: () -> Unit = {}, diff --git a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenEvent.kt b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenEvent.kt index fbc08bc4..c518b4ed 100644 --- a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenEvent.kt +++ b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenEvent.kt @@ -1,6 +1,6 @@ package club.nito.feature.auth -sealed class LoginScreenEvent { - data object LoggedIn : LoginScreenEvent() - data object NavigateToRegister : LoginScreenEvent() +public sealed class LoginScreenEvent { + public data object LoggedIn : LoginScreenEvent() + public data object NavigateToRegister : LoginScreenEvent() } diff --git a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenIntent.kt b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenIntent.kt index b4908342..5c901c3b 100644 --- a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenIntent.kt +++ b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenIntent.kt @@ -1,8 +1,8 @@ package club.nito.feature.auth -sealed class LoginScreenIntent { - data class ChangeInputEmail(val email: String) : LoginScreenIntent() - data class ChangeInputPassword(val password: String) : LoginScreenIntent() - data object ClickSignIn : LoginScreenIntent() - data object ClickRegister : LoginScreenIntent() +public sealed class LoginScreenIntent { + public data class ChangeInputEmail(val email: String) : LoginScreenIntent() + public data class ChangeInputPassword(val password: String) : LoginScreenIntent() + public data object ClickSignIn : LoginScreenIntent() + public data object ClickRegister : LoginScreenIntent() } diff --git a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenStateMachine.kt b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenStateMachine.kt index 115ad732..bc63e04c 100644 --- a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenStateMachine.kt +++ b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenStateMachine.kt @@ -18,10 +18,10 @@ import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch -class LoginScreenStateMachine internal constructor( +public class LoginScreenStateMachine internal constructor( observeAuthStatusUseCase: ObserveAuthStatusUseCase, private val signInUseCase: SignInUseCase, - val userMessageStateHolder: UserMessageStateHolder, + public val userMessageStateHolder: UserMessageStateHolder, ) : StateMachine(), UserMessageStateHolder by userMessageStateHolder { @@ -33,7 +33,7 @@ class LoginScreenStateMachine internal constructor( initialValue = FetchSingleResult.Loading, ) - val uiState: StateFlow = buildUiState( + public val uiState: StateFlow = buildUiState( email, password, authStatus, @@ -46,7 +46,7 @@ class LoginScreenStateMachine internal constructor( } private val _events = MutableStateFlow>(emptyList()) - val event: Flow = _events.map { it.firstOrNull() } + public val event: Flow = _events.map { it.firstOrNull() } init { stateMachineScope.launch { @@ -58,7 +58,7 @@ class LoginScreenStateMachine internal constructor( } } - fun dispatch(intent: LoginScreenIntent) { + public fun dispatch(intent: LoginScreenIntent) { stateMachineScope.launch { when (intent) { is LoginScreenIntent.ChangeInputEmail -> email.emit(intent.email) @@ -75,7 +75,7 @@ class LoginScreenStateMachine internal constructor( } } - fun consume(event: LoginScreenEvent) { + public fun consume(event: LoginScreenEvent) { stateMachineScope.launch { _events.emit(_events.value.filterNot { it == event }) } diff --git a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenUiState.kt b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenUiState.kt index a6254116..684749b9 100644 --- a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenUiState.kt +++ b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/LoginScreenUiState.kt @@ -1,6 +1,6 @@ package club.nito.feature.auth -data class LoginScreenUiState( +public data class LoginScreenUiState( val email: String, val password: String, val isSignInning: Boolean, diff --git a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/di/AuthFeatureModule.kt b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/di/AuthFeatureModule.kt index facc00b0..88306de5 100644 --- a/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/di/AuthFeatureModule.kt +++ b/feature/auth/src/commonMain/kotlin/club/nito/feature/auth/di/AuthFeatureModule.kt @@ -4,7 +4,7 @@ import club.nito.feature.auth.LoginScreenStateMachine import org.koin.core.module.Module import org.koin.dsl.module -val authFeatureModule: Module = module { +public val authFeatureModule: Module = module { factory { LoginScreenStateMachine( observeAuthStatusUseCase = get(),