diff --git a/application/common_flows/wide_screen_common/src/commonMain/kotlin/io/writeopia/notes/desktop/components/App.kt b/application/common_flows/wide_screen_common/src/commonMain/kotlin/io/writeopia/notes/desktop/components/App.kt index 563b21275..93dcd16f5 100644 --- a/application/common_flows/wide_screen_common/src/commonMain/kotlin/io/writeopia/notes/desktop/components/App.kt +++ b/application/common_flows/wide_screen_common/src/commonMain/kotlin/io/writeopia/notes/desktop/components/App.kt @@ -243,7 +243,9 @@ fun DesktopApp( ) } - val showSettingsState by globalShellViewModel.showSettingsState.collectAsState() + val showSettingsState by globalShellViewModel + .showSettingsState + .collectAsState() if (showSettingsState) { SettingsDialog( @@ -264,7 +266,9 @@ fun DesktopApp( ) } - val showSearchState by globalShellViewModel.showSearchDialog.collectAsState() + val showSearchState by globalShellViewModel + .showSearchDialog + .collectAsState() if (showSearchState) { LaunchedEffect(true) { diff --git a/application/composeApp/build.gradle.kts b/application/composeApp/build.gradle.kts index 8408b5cbc..9455b4330 100644 --- a/application/composeApp/build.gradle.kts +++ b/application/composeApp/build.gradle.kts @@ -167,8 +167,8 @@ android { applicationId = "io.writeopia" minSdk = 24 targetSdk = 35 - versionCode = 24 - versionName = "0.12.0" + versionCode = 25 + versionName = "0.13.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } diff --git a/application/composeApp/src/androidMain/AndroidManifest.xml b/application/composeApp/src/androidMain/AndroidManifest.xml index 0b1285888..852c6c516 100644 --- a/application/composeApp/src/androidMain/AndroidManifest.xml +++ b/application/composeApp/src/androidMain/AndroidManifest.xml @@ -10,7 +10,7 @@ android:dataExtractionRules="@xml/data_extraction_rules" android:fullBackupContent="@xml/backup_rules" android:icon="@mipmap/ic_launcher" - android:label="@string/app_name" + android:label="Writeopia" android:supportsRtl="true" android:theme="@style/Theme.Writeopia" android:usesCleartextTraffic="true" diff --git a/application/composeApp/src/jvmMain/kotlin/io/writeopia/desktop/MainDesktop.kt b/application/composeApp/src/jvmMain/kotlin/io/writeopia/desktop/MainDesktop.kt index 8c9e9c49e..49725a609 100644 --- a/application/composeApp/src/jvmMain/kotlin/io/writeopia/desktop/MainDesktop.kt +++ b/application/composeApp/src/jvmMain/kotlin/io/writeopia/desktop/MainDesktop.kt @@ -138,8 +138,6 @@ private fun ApplicationScope.DesktopApp(onCloseRequest: () -> Unit = ::exitAppli ) val topDoubleBarClick = { - println("topDoubleBarClick") - if (windowState.placement == WindowPlacement.Floating) { windowState.placement = WindowPlacement.Maximized } else { diff --git a/application/core/common_ui/build.gradle.kts b/application/core/common_ui/build.gradle.kts index f67d2ecba..47a9e8173 100644 --- a/application/core/common_ui/build.gradle.kts +++ b/application/core/common_ui/build.gradle.kts @@ -36,8 +36,6 @@ kotlin { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material3) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) implementation(compose.components.uiToolingPreview) } } diff --git a/application/core/resources/build.gradle.kts b/application/core/resources/build.gradle.kts index dc13aadab..ef26e5ee0 100644 --- a/application/core/resources/build.gradle.kts +++ b/application/core/resources/build.gradle.kts @@ -1,36 +1,35 @@ plugins { - alias(libs.plugins.androidLibrary) - alias(libs.plugins.kotlinAndroid) + kotlin("multiplatform") alias(libs.plugins.ktlint) + alias(libs.plugins.compose.multiplatform) + alias(libs.plugins.compose.multiplatform.compiler) } -android { - namespace = "io.writeopia.appresourcers" - compileSdk = 35 - defaultConfig { - minSdk = 24 +kotlin { + jvm {} - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") + js(IR) { + browser() + binaries.library() } - buildTypes { - release { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" - ) + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { iosTarget -> + iosTarget.binaries.framework { + baseName = "WriteopiaCoreResources" + isStatic = true } } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - } -} -dependencies { - implementation(libs.androidx.ktx) - implementation(libs.appCompat) + sourceSets { + commonMain.dependencies { + implementation(compose.runtime) + implementation(compose.foundation) + implementation(compose.components.resources) + } + } } diff --git a/application/core/resources/config/ktlint/baseline.xml b/application/core/resources/config/ktlint/baseline.xml index 981420778..ea388685b 100644 --- a/application/core/resources/config/ktlint/baseline.xml +++ b/application/core/resources/config/ktlint/baseline.xml @@ -1,3 +1,3388 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/core/resources/src/main/res/drawable/bottom_end_corner_auth_background.xml b/application/core/resources/src/commonMain/composeResources/drawable/bottom_end_corner_auth_background.xml similarity index 100% rename from application/core/resources/src/main/res/drawable/bottom_end_corner_auth_background.xml rename to application/core/resources/src/commonMain/composeResources/drawable/bottom_end_corner_auth_background.xml diff --git a/application/core/resources/src/main/res/drawable/ic_auth_menu_logo.xml b/application/core/resources/src/commonMain/composeResources/drawable/ic_auth_menu_logo.xml similarity index 100% rename from application/core/resources/src/main/res/drawable/ic_auth_menu_logo.xml rename to application/core/resources/src/commonMain/composeResources/drawable/ic_auth_menu_logo.xml diff --git a/application/core/resources/src/main/res/drawable/image_writeopia_logo.xml b/application/core/resources/src/commonMain/composeResources/drawable/image_writeopia_logo.xml similarity index 100% rename from application/core/resources/src/main/res/drawable/image_writeopia_logo.xml rename to application/core/resources/src/commonMain/composeResources/drawable/image_writeopia_logo.xml diff --git a/application/core/resources/src/main/res/drawable/top_background_auth.xml b/application/core/resources/src/commonMain/composeResources/drawable/top_background_auth.xml similarity index 100% rename from application/core/resources/src/main/res/drawable/top_background_auth.xml rename to application/core/resources/src/commonMain/composeResources/drawable/top_background_auth.xml diff --git a/application/core/resources/src/commonMain/composeResources/values-en/strings.xml b/application/core/resources/src/commonMain/composeResources/values-en/strings.xml new file mode 100644 index 000000000..ae17e002f --- /dev/null +++ b/application/core/resources/src/commonMain/composeResources/values-en/strings.xml @@ -0,0 +1,75 @@ + + Writeopia + Error loading notes + You don\'t have notes + Add sample notes + Undo + Redo + untitled + Note + More options + staggered card + note list + Arrangement + Sorting + Last updated + Create + Name + Add note + Back + Copy note + Favorite + Delete + Logout + Export as Json + Export as Markdown + Export + %s Workspace + Offline Workspace + Disconnected + Email + Password + Enter + Visible + Not Visible + Sign in + Sign up with email + Enter without register + Register + Search + Home + Favorites + Settings + Folder + Recent + Color Theme + Local Folder + Available Models + No models + Error when requesting models. Did you start Ollama? \n + Retry + Download Model + Suggestions: + Error when downloading model. + "Version: alpha26 - Amado, Jorge" + Light + Dark + System + Export as Markdown + Import file + Sort by name + Sort by creation + Sort by last update + Lock document + Move to... + Move home + Text + Insert + Decoration + Box + Content + Image + Page + Ask AI + Tap here to write the next big thing + diff --git a/application/core/resources/src/commonMain/composeResources/values-pt/strings.xml b/application/core/resources/src/commonMain/composeResources/values-pt/strings.xml new file mode 100644 index 000000000..6c3527b2c --- /dev/null +++ b/application/core/resources/src/commonMain/composeResources/values-pt/strings.xml @@ -0,0 +1,74 @@ + + Writeopia + Error loading notes + You don\'t have notes + Add sample notes + Undo + Redo + untitled + Nota + More options + staggered card + note list + Disposição + Ordenação + Atualização + Criação + Nome + Add note + Back + Copy note + Favorite + Delete + Logout + Export as Json + Export as Markdown + Export + %s Workspace + Offline Workspace + Disconnected + Email + Password + Enter + Visible + Not Visible + Sign in + Sign up with email + Enter without register + Registrar + Pesquisar + Home + Favoritos + Configurações + Pastas + Recente + Tema de cor + Local Folder + Modelos disponíveis + Nenhum modelo encontrado + Erro ao buscar modelos. Você está rodando o Ollama? \n + Tentar de novo + Baixar modelos + Sugestões: + Error ao baixar modelo. + "Versão: alpha26 - Amado, Jorge" + Claro + Escuro + Sistema + Exportar como Markdown + Importar arquivo + Ordenar por nome + Ordenar por data de criação + Ordenar por data de atualização + Bloquear edição + Move para... + Move home + Texto + Inserir + Caixa + Conteúdo + Imagem + Página + Pergunte à IA + Click aqui para escrever sua próxima grande idéia + diff --git a/application/core/resources/src/commonMain/composeResources/values/strings.xml b/application/core/resources/src/commonMain/composeResources/values/strings.xml new file mode 100644 index 000000000..d5ef71f1e --- /dev/null +++ b/application/core/resources/src/commonMain/composeResources/values/strings.xml @@ -0,0 +1,80 @@ + + Writeopia + Error loading notes + You don\'t have notes + Add sample notes + Undo + Redo + untitled + Note + More options + staggered card + note list + Arrangement + Sorting + Last updated + Create + Name + Add note + Back + Copy note + Favorite + Delete + Logout + Export as Json + Export as Markdown + Export + %s Workspace + Offline Workspace + Disconnected + Email + Password + Enter + Visible + Not Visible + Sign in + Sign up with email + Enter without register + Register + Search + Home + Favorites + Settings + Folder + Recent + Color Theme + Local Folder + Ollama + Url + Available Models + No models + Error when requesting models. Did you start Ollama? \n + Retry + Download Model + Suggestions: + Error when downloading model. + Version: alpha26 - Amado, Jorge + Light + Dark + System + Export as Markdown + Import file + Sort by name + Sort by creation date + Sort by last update + Lock document + Move to... + Move home + Text + Insert + Decoration + Box + Content + Image + Links + Page + Ask AI + JSON + Tap here to write the next big thing + + diff --git a/application/core/resources/src/commonMain/kotlin/io/writeopia/resources/WrStrings.kt b/application/core/resources/src/commonMain/kotlin/io/writeopia/resources/WrStrings.kt new file mode 100644 index 000000000..5b9c45e6b --- /dev/null +++ b/application/core/resources/src/commonMain/kotlin/io/writeopia/resources/WrStrings.kt @@ -0,0 +1,192 @@ +package io.writeopia.resources + +import androidx.compose.runtime.Composable +import org.jetbrains.compose.resources.stringResource +import writeopia.application.core.resources.generated.resources.Res +import writeopia.application.core.resources.generated.resources.arrangement +import writeopia.application.core.resources.generated.resources.ask_ai +import writeopia.application.core.resources.generated.resources.available_models +import writeopia.application.core.resources.generated.resources.box +import writeopia.application.core.resources.generated.resources.color_theme +import writeopia.application.core.resources.generated.resources.content +import writeopia.application.core.resources.generated.resources.dark_theme +import writeopia.application.core.resources.generated.resources.decoration +import writeopia.application.core.resources.generated.resources.download_models +import writeopia.application.core.resources.generated.resources.error_model_download +import writeopia.application.core.resources.generated.resources.error_requesting_models +import writeopia.application.core.resources.generated.resources.export +import writeopia.application.core.resources.generated.resources.export_markdown +import writeopia.application.core.resources.generated.resources.favorites +import writeopia.application.core.resources.generated.resources.folder +import writeopia.application.core.resources.generated.resources.home +import writeopia.application.core.resources.generated.resources.image +import writeopia.application.core.resources.generated.resources.import_file +import writeopia.application.core.resources.generated.resources.insert +import writeopia.application.core.resources.generated.resources.json +import writeopia.application.core.resources.generated.resources.last_created +import writeopia.application.core.resources.generated.resources.last_updated +import writeopia.application.core.resources.generated.resources.light_theme +import writeopia.application.core.resources.generated.resources.links +import writeopia.application.core.resources.generated.resources.local_folder +import writeopia.application.core.resources.generated.resources.lock_document +import writeopia.application.core.resources.generated.resources.move_to +import writeopia.application.core.resources.generated.resources.move_to_home +import writeopia.application.core.resources.generated.resources.name +import writeopia.application.core.resources.generated.resources.no_models +import writeopia.application.core.resources.generated.resources.ollama +import writeopia.application.core.resources.generated.resources.page +import writeopia.application.core.resources.generated.resources.recent +import writeopia.application.core.resources.generated.resources.retry +import writeopia.application.core.resources.generated.resources.search +import writeopia.application.core.resources.generated.resources.settings +import writeopia.application.core.resources.generated.resources.sort_by_creation +import writeopia.application.core.resources.generated.resources.sort_by_name +import writeopia.application.core.resources.generated.resources.sort_by_update +import writeopia.application.core.resources.generated.resources.sorting +import writeopia.application.core.resources.generated.resources.suggestions +import writeopia.application.core.resources.generated.resources.system_theme +import writeopia.application.core.resources.generated.resources.tap_to_start +import writeopia.application.core.resources.generated.resources.text +import writeopia.application.core.resources.generated.resources.url +import writeopia.application.core.resources.generated.resources.version + +object WrStrings { + + @Composable + fun search() = stringResource(Res.string.search) + + @Composable + fun home() = stringResource(Res.string.home) + + @Composable + fun favorites() = stringResource(Res.string.favorites) + + @Composable + fun settings() = stringResource(Res.string.settings) + + @Composable + fun folder() = stringResource(Res.string.folder) + + @Composable + fun recent() = stringResource(Res.string.recent) + + @Composable + fun colorTheme() = stringResource(Res.string.color_theme) + + @Composable + fun localFolder() = stringResource(Res.string.local_folder) + + @Composable + fun ollama() = stringResource(Res.string.ollama) + + @Composable + fun url() = stringResource(Res.string.url) + + @Composable + fun availableModels() = stringResource(Res.string.available_models) + + @Composable + fun noModelsFound() = stringResource(Res.string.no_models) + + @Composable + fun errorRequestingModels() = stringResource(Res.string.error_requesting_models) + + @Composable + fun retry() = stringResource(Res.string.retry) + + @Composable + fun downloadModels() = stringResource(Res.string.download_models) + + @Composable + fun suggestions() = stringResource(Res.string.suggestions) + + @Composable + fun errorModelDownload() = stringResource(Res.string.error_model_download) + + @Composable + fun version() = stringResource(Res.string.version) + + @Composable + fun lightTheme() = stringResource(Res.string.light_theme) + + @Composable + fun darkTheme() = stringResource(Res.string.dark_theme) + + @Composable + fun systemTheme() = stringResource(Res.string.system_theme) + + @Composable + fun exportMarkdown() = stringResource(Res.string.export_markdown) + + @Composable + fun importFile() = stringResource(Res.string.import_file) + + @Composable + fun sortByName() = stringResource(Res.string.sort_by_name) + + @Composable + fun sortByCreation() = stringResource(Res.string.sort_by_creation) + + @Composable + fun sortByUpdate() = stringResource(Res.string.sort_by_update) + + @Composable + fun lockDocument() = stringResource(Res.string.lock_document) + + @Composable + fun moveTo() = stringResource(Res.string.move_to) + + @Composable + fun moveToHome() = stringResource(Res.string.move_to_home) + + @Composable + fun text() = stringResource(Res.string.text) + + @Composable + fun insert() = stringResource(Res.string.insert) + + @Composable + fun decoration() = stringResource(Res.string.decoration) + + @Composable + fun box() = stringResource(Res.string.box) + + @Composable + fun content() = stringResource(Res.string.content) + + @Composable + fun image() = stringResource(Res.string.image) + + @Composable + fun links() = stringResource(Res.string.links) + + @Composable + fun page() = stringResource(Res.string.page) + + @Composable + fun askAi() = stringResource(Res.string.ask_ai) + + @Composable + fun export() = stringResource(Res.string.export) + + @Composable + fun json() = stringResource(Res.string.json) + + @Composable + fun tapToStart() = stringResource(Res.string.tap_to_start) + + @Composable + fun arrangement() = stringResource(Res.string.arrangement) + + @Composable + fun sorting() = stringResource(Res.string.sorting) + + @Composable + fun lastUpdated() = stringResource(Res.string.last_updated) + + @Composable + fun created() = stringResource(Res.string.last_created) + + @Composable + fun name() = stringResource(Res.string.name) +} diff --git a/application/core/resources/src/main/AndroidManifest.xml b/application/core/resources/src/main/AndroidManifest.xml deleted file mode 100644 index a5918e68a..000000000 --- a/application/core/resources/src/main/AndroidManifest.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/application/core/resources/src/main/res/values/strings.xml b/application/core/resources/src/main/res/values/strings.xml deleted file mode 100644 index 7f8ad5402..000000000 --- a/application/core/resources/src/main/res/values/strings.xml +++ /dev/null @@ -1,39 +0,0 @@ - - Writeopia - Error loading notes - You don\'t have notes - Add sample notes - Undo - Redo - untitled - Note - More options - staggered card - note list - Arrangement - Sorting - Last updated - Create - Name - Add note - Back - Copy note - Favorite - Delete - Logout - Export as Json - Export as Markdown - Export - %s Workspace - Offline Workspace - Disconnected - Email - Password - Enter - Visible - Not Visible - Sign in - Sign up with email - Enter without register - Register - diff --git a/application/features/account/build.gradle.kts b/application/features/account/build.gradle.kts index 87d32ed6b..5f8947fbc 100644 --- a/application/features/account/build.gradle.kts +++ b/application/features/account/build.gradle.kts @@ -35,6 +35,7 @@ kotlin { implementation(project(":application:core:theme")) implementation(project(":application:core:common_ui")) implementation(project(":application:core:ollama")) + implementation(project(":application:core:resources")) implementation(libs.kotlinx.datetime) @@ -42,7 +43,6 @@ kotlin { implementation(compose.foundation) implementation(compose.material3) @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) implementation(libs.compose.navigation) } } diff --git a/application/features/account/config/ktlint/baseline.xml b/application/features/account/config/ktlint/baseline.xml index a4f0834df..981420778 100644 --- a/application/features/account/config/ktlint/baseline.xml +++ b/application/features/account/config/ktlint/baseline.xml @@ -1,151 +1,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/application/features/account/src/commonMain/kotlin/io/writeopia/account/ui/SettingsDialog.kt b/application/features/account/src/commonMain/kotlin/io/writeopia/account/ui/SettingsDialog.kt index 2014053bb..44d7b32be 100644 --- a/application/features/account/src/commonMain/kotlin/io/writeopia/account/ui/SettingsDialog.kt +++ b/application/features/account/src/commonMain/kotlin/io/writeopia/account/ui/SettingsDialog.kt @@ -49,6 +49,7 @@ import io.writeopia.common.utils.download.DownloadState import io.writeopia.common.utils.icons.WrIcons import io.writeopia.commonui.workplace.WorkspaceConfigurationDialog import io.writeopia.model.ColorThemeOption +import io.writeopia.resources.WrStrings import io.writeopia.theme.WriteopiaTheme import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.StateFlow @@ -133,7 +134,7 @@ fun SettingsScreen( mutableStateOf(false) } - Text("Color Theme", style = titleStyle, color = titleColor) + Text(WrStrings.colorTheme(), style = titleStyle, color = titleColor) Spacer(modifier = Modifier.height(SPACE_AFTER_TITLE.dp)) @@ -145,7 +146,7 @@ fun SettingsScreen( Spacer(modifier = Modifier.height(20.dp)) if (showPath) { - Text("Local Folder", style = titleStyle, color = titleColor) + Text(WrStrings.localFolder(), style = titleStyle, color = titleColor) Spacer(modifier = Modifier.height(SPACE_AFTER_TITLE.dp)) @@ -189,11 +190,11 @@ fun SettingsScreen( val ollamaSelected by ollamaSelectedModel.collectAsState() if (showOllamaConfig) { - Text("Ollama", style = titleStyle, color = titleColor) + Text(WrStrings.ollama(), style = titleStyle, color = titleColor) Spacer(modifier = Modifier.height(SPACE_AFTER_TITLE.dp)) - Text("Url", style = MaterialTheme.typography.bodyMedium, color = titleColor) + Text(WrStrings.url(), style = MaterialTheme.typography.bodyMedium, color = titleColor) Spacer(modifier = Modifier.height(SPACE_AFTER_SUB_TITLE.dp)) @@ -215,7 +216,7 @@ fun SettingsScreen( Spacer(modifier = Modifier.height(14.dp)) Text( - "Available Models", + WrStrings.availableModels(), style = MaterialTheme.typography.bodyMedium, color = titleColor ) @@ -273,7 +274,7 @@ fun SettingsScreen( is ResultData.Error -> { val errorText = buildAnnotatedString { - append("Error when requesting models. Did you start Ollama? \n") + append(WrStrings.errorRequestingModels()) withLink(LinkAnnotation.Url("https://ollama.com")) { withStyle(style = SpanStyle(color = WriteopiaTheme.colorScheme.linkColor)) { append("https://ollama.com") @@ -300,7 +301,7 @@ fun SettingsScreen( MaterialTheme.shapes.medium ) .padding(4.dp), - text = "Retry", + text = WrStrings.retry(), style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onBackground, ) @@ -315,7 +316,11 @@ fun SettingsScreen( Spacer(modifier = Modifier.height(14.dp)) - Text("Download Model", style = MaterialTheme.typography.bodyMedium, color = titleColor) + Text( + WrStrings.downloadModels(), + style = MaterialTheme.typography.bodyMedium, + color = titleColor + ) Spacer(modifier = Modifier.height(SPACE_AFTER_SUB_TITLE.dp)) @@ -324,7 +329,7 @@ fun SettingsScreen( } Row(verticalAlignment = Alignment.CenterVertically) { - Text(text = "Suggestions:", style = MaterialTheme.typography.bodySmall) + Text(text = WrStrings.suggestions(), style = MaterialTheme.typography.bodySmall) Spacer(modifier = Modifier.width(6.dp)) @@ -386,7 +391,7 @@ fun SettingsScreen( Spacer(modifier = Modifier.height(4.dp)) Text( - "Error when downloading model. ${downloadState.exception.message}", + "${WrStrings.errorModelDownload()} ${downloadState.exception.message}", style = MaterialTheme.typography.bodySmall ) } @@ -417,7 +422,7 @@ fun SettingsScreen( Spacer(modifier = Modifier.height(30.dp)) - Text("Version: alpha25 - Amado, Jorge", style = MaterialTheme.typography.bodySmall) + Text(WrStrings.version(), style = MaterialTheme.typography.bodySmall) } @Composable @@ -429,9 +434,9 @@ private fun ColorThemeOptions( Row(modifier = Modifier.fillMaxWidth().height(70.dp)) { Option( - text = "Light", + text = WrStrings.lightTheme(), imageVector = WrIcons.colorModeLight, - contextDescription = "light", + contextDescription = WrStrings.lightTheme(), selectColorTheme = { selectColorTheme(ColorThemeOption.LIGHT) } @@ -440,9 +445,9 @@ private fun ColorThemeOptions( Spacer(modifier = Modifier.width(spaceWidth)) Option( - text = "Dark", + text = WrStrings.darkTheme(), imageVector = WrIcons.colorModeDark, - contextDescription = "dark", + contextDescription = WrStrings.darkTheme(), selectColorTheme = { selectColorTheme(ColorThemeOption.DARK) } @@ -451,9 +456,9 @@ private fun ColorThemeOptions( Spacer(modifier = Modifier.width(spaceWidth)) Option( - text = "System", + text = WrStrings.systemTheme(), imageVector = WrIcons.colorModeSystem, - contextDescription = "system", + contextDescription = WrStrings.systemTheme(), selectColorTheme = { selectColorTheme(ColorThemeOption.SYSTEM) } diff --git a/application/features/editor/build.gradle.kts b/application/features/editor/build.gradle.kts index 8b62861d6..54e3ee359 100644 --- a/application/features/editor/build.gradle.kts +++ b/application/features/editor/build.gradle.kts @@ -50,6 +50,7 @@ kotlin { implementation(project(":application:core:folders")) implementation(project(":application:core:models")) implementation(project(":application:core:ollama")) + implementation(project(":application:core:resources")) implementation(libs.kotlinx.serialization.json) implementation(libs.kotlinx.datetime) @@ -57,8 +58,6 @@ kotlin { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material3) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) implementation(libs.compose.navigation) } } diff --git a/application/features/editor/config/ktlint/baseline.xml b/application/features/editor/config/ktlint/baseline.xml index b10b7fbd0..981420778 100644 --- a/application/features/editor/config/ktlint/baseline.xml +++ b/application/features/editor/config/ktlint/baseline.xml @@ -1,159 +1,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/application/features/editor/src/commonMain/kotlin/io/writeopia/editor/features/editor/ui/desktop/edit/menu/MenuButtons.kt b/application/features/editor/src/commonMain/kotlin/io/writeopia/editor/features/editor/ui/desktop/edit/menu/MenuButtons.kt index 896029fe1..cf9165767 100644 --- a/application/features/editor/src/commonMain/kotlin/io/writeopia/editor/features/editor/ui/desktop/edit/menu/MenuButtons.kt +++ b/application/features/editor/src/commonMain/kotlin/io/writeopia/editor/features/editor/ui/desktop/edit/menu/MenuButtons.kt @@ -22,6 +22,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import io.writeopia.common.utils.icons.WrIcons +import io.writeopia.resources.WrStrings import io.writeopia.theme.WriteopiaTheme import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow @@ -33,8 +34,8 @@ fun LockButton( ) { CommonButton( icon = WrIcons.lock, - iconDescription = "Lock", - text = "Lock document", + iconDescription = WrStrings.lockDocument(), + text = WrStrings.lockDocument(), isEnabledState = isEditableState, clickListener = setEditable ) @@ -44,8 +45,8 @@ fun LockButton( fun MoveToButton(clickListener: () -> Unit) { CommonButton( icon = WrIcons.move, - iconDescription = "Move icon", - text = "Move to...", + iconDescription = WrStrings.moveTo(), + text = WrStrings.moveTo(), clickListener = clickListener ) } @@ -54,8 +55,8 @@ fun MoveToButton(clickListener: () -> Unit) { fun MoveToHomeButton(clickListener: () -> Unit) { CommonButton( icon = WrIcons.move, - iconDescription = "Move icon", - text = "Move Home", + iconDescription = WrStrings.moveToHome(), + text = WrStrings.moveToHome(), clickListener = clickListener ) } diff --git a/application/features/editor/src/commonMain/kotlin/io/writeopia/editor/features/editor/ui/desktop/edit/menu/SideEditorOptions.kt b/application/features/editor/src/commonMain/kotlin/io/writeopia/editor/features/editor/ui/desktop/edit/menu/SideEditorOptions.kt index c12c7f576..aa03c1dac 100644 --- a/application/features/editor/src/commonMain/kotlin/io/writeopia/editor/features/editor/ui/desktop/edit/menu/SideEditorOptions.kt +++ b/application/features/editor/src/commonMain/kotlin/io/writeopia/editor/features/editor/ui/desktop/edit/menu/SideEditorOptions.kt @@ -48,6 +48,7 @@ import io.writeopia.common.utils.file.fileChooserLoad import io.writeopia.common.utils.file.fileChooserSave import io.writeopia.common.utils.icons.WrIcons import io.writeopia.model.Font +import io.writeopia.resources.WrStrings import io.writeopia.sdk.models.span.Span import io.writeopia.theme.WriteopiaTheme import io.writeopia.ui.icons.WrSdkIcons @@ -522,40 +523,40 @@ private fun TextOptions( .width(250.dp) .padding(start = 12.dp, end = 12.dp, top = 8.dp, bottom = 12.dp) ) { - Title("Text") + Title(WrStrings.text()) Spacer(modifier = Modifier.height(4.dp)) TextChanges(spanClick) Spacer(modifier = Modifier.height(8.dp)) - Title("Insert") + Title(WrStrings.insert()) Spacer(modifier = Modifier.height(4.dp)) InsertCommand(checkItemClick, listItemClick, codeBlockClick) Spacer(modifier = Modifier.height(8.dp)) - Title("Decoration") + Title(WrStrings.decoration()) Spacer(modifier = Modifier.height(4.dp)) DecorationCommands( commands = listOf( - "Box" to highLightBlockClick, - "Warning" to {}, - "Tip" to {}, - "Code" to {} + WrStrings.box() to highLightBlockClick, +// "Warning" to {}, +// "Tip" to {}, +// "Code" to {} ) ) Spacer(modifier = Modifier.height(8.dp)) - Title("Content") + Title(WrStrings.content()) Spacer(modifier = Modifier.height(4.dp)) - IconAndText("Image", WrIcons.image) { + IconAndText(WrStrings.image(), WrIcons.image) { fileChooserLoad("")?.let(addImage) } Spacer(modifier = Modifier.height(8.dp)) - Title("Links") + Title(WrStrings.links()) Spacer(modifier = Modifier.height(4.dp)) - IconAndText("Page", WrIcons.file, addPage) + IconAndText(WrStrings.page(), WrIcons.file, addPage) } } @@ -575,33 +576,33 @@ private fun Actions( .width(250.dp) .padding(start = 12.dp, end = 12.dp, top = 8.dp, bottom = 12.dp) ) { - Title("Ask IA") + Title(WrStrings.askAi()) Spacer(modifier = Modifier.height(4.dp)) TextButton( modifier = Modifier.fillMaxWidth(), - text = "Ask AI", + text = WrStrings.askAi(), paddingValues = smallButtonPadding(), onClick = askAiBySelection ) - TextButton( - modifier = Modifier.fillMaxWidth(), - text = "AI question box", - paddingValues = smallButtonPadding() - ) { } +// TextButton( +// modifier = Modifier.fillMaxWidth(), +// text = "AI question box", +// paddingValues = smallButtonPadding() +// ) { } - Spacer(modifier = Modifier.height(8.dp)) +// Spacer(modifier = Modifier.height(8.dp)) - Title("Export") + Title(WrStrings.export()) Spacer(modifier = Modifier.height(4.dp)) Row { TextButton( modifier = Modifier.weight(1F), - text = "Json", + text = WrStrings.json(), paddingValues = smallButtonPadding() ) { fileChooserSave()?.let { diff --git a/application/features/global_shell/build.gradle.kts b/application/features/global_shell/build.gradle.kts index a81f4b1d6..d3cd4b360 100644 --- a/application/features/global_shell/build.gradle.kts +++ b/application/features/global_shell/build.gradle.kts @@ -46,6 +46,7 @@ kotlin { implementation(project(":application:core:common_ui")) implementation(project(":application:core:folders")) implementation(project(":application:core:ollama")) + implementation(project(":application:core:resources")) implementation(project(":application:features:note_menu")) @@ -55,8 +56,6 @@ kotlin { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material3) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) implementation(libs.compose.navigation) implementation(compose.components.uiToolingPreview) implementation(libs.lifecycle.viewmodel.compose) diff --git a/application/features/global_shell/config/ktlint/baseline.xml b/application/features/global_shell/config/ktlint/baseline.xml index aa159f6aa..981420778 100644 --- a/application/features/global_shell/config/ktlint/baseline.xml +++ b/application/features/global_shell/config/ktlint/baseline.xml @@ -1,161 +1,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/application/features/global_shell/src/commonMain/kotlin/io/writeopia/global/shell/SideGlobalMenu.kt b/application/features/global_shell/src/commonMain/kotlin/io/writeopia/global/shell/SideGlobalMenu.kt index 9e2c32733..46cb17cd7 100644 --- a/application/features/global_shell/src/commonMain/kotlin/io/writeopia/global/shell/SideGlobalMenu.kt +++ b/application/features/global_shell/src/commonMain/kotlin/io/writeopia/global/shell/SideGlobalMenu.kt @@ -37,6 +37,7 @@ import io.writeopia.common.utils.icons.IconChange import io.writeopia.common.utils.icons.WrIcons import io.writeopia.commonui.dtos.MenuItemUi import io.writeopia.commonui.folders.DocumentList +import io.writeopia.resources.WrStrings import io.writeopia.theme.WriteopiaTheme import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow @@ -92,34 +93,34 @@ fun SideGlobalMenu( settingsOptions( iconVector = WrIcons.search, - contentDescription = "Search", - text = "Search", + contentDescription = WrStrings.search(), + text = WrStrings.search(), click = searchClick ) settingsOptions( iconVector = WrIcons.home, - contentDescription = "Home", - text = "Home", + contentDescription = WrStrings.home(), + text = WrStrings.home(), click = homeClick ) settingsOptions( iconVector = WrIcons.favorites, - contentDescription = "Favorites", - text = "Favorites", + contentDescription = WrStrings.favorites(), + text = WrStrings.favorites(), click = favoritesClick ) settingsOptions( iconVector = WrIcons.settings, - contentDescription = "Settings", - text = "Settings", + contentDescription = WrStrings.settings(), + text = WrStrings.settings(), click = settingsClick, ) title( - text = "Folder", + text = WrStrings.folder(), trailingContent = { Icon( imageVector = WrIcons.target, diff --git a/application/features/note_menu/build.gradle.kts b/application/features/note_menu/build.gradle.kts index a1e826c45..1e477020b 100644 --- a/application/features/note_menu/build.gradle.kts +++ b/application/features/note_menu/build.gradle.kts @@ -47,6 +47,7 @@ kotlin { implementation(project(":application:core:persistence_bridge")) implementation(project(":application:core:theme")) implementation(project(":application:core:folders")) + implementation(project(":application:core:resources")) implementation(project(":application:features:account")) @@ -55,8 +56,6 @@ kotlin { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material3) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) implementation(compose.components.uiToolingPreview) implementation(libs.kotlinx.serialization.json) implementation(libs.compose.navigation) diff --git a/application/features/note_menu/config/ktlint/baseline.xml b/application/features/note_menu/config/ktlint/baseline.xml index 1ac7b6fb1..562ac5544 100644 --- a/application/features/note_menu/config/ktlint/baseline.xml +++ b/application/features/note_menu/config/ktlint/baseline.xml @@ -1,163 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -165,21 +7,11 @@ - + - - - - - - - - - - - - - + + + diff --git a/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/actions/DesktopNoteActionsMenu.kt b/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/actions/DesktopNoteActionsMenu.kt index d325e7d14..329adb241 100644 --- a/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/actions/DesktopNoteActionsMenu.kt +++ b/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/actions/DesktopNoteActionsMenu.kt @@ -20,6 +20,7 @@ import androidx.compose.ui.unit.dp import io.writeopia.common.utils.icons.WrIcons import io.writeopia.notemenu.ui.screen.configuration.modifier.icon import io.writeopia.notemenu.viewmodel.SyncState +import io.writeopia.resources.WrStrings import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import org.jetbrains.compose.ui.tooling.preview.Preview @@ -102,7 +103,7 @@ private fun MoreOptions( }, onClick = exportAsMarkdownClick, text = { - Text("Export as Markdown", color = MaterialTheme.colorScheme.onBackground) + Text(WrStrings.exportMarkdown(), color = MaterialTheme.colorScheme.onBackground) } ) @@ -110,13 +111,13 @@ private fun MoreOptions( leadingIcon = { Icon( imageVector = WrIcons.fileDownload, - contentDescription = "Import file", + contentDescription = WrStrings.importFile(), tint = iconTintColor ) }, onClick = importClick, text = { - Text("Import file", color = MaterialTheme.colorScheme.onBackground) + Text(WrStrings.importFile(), color = MaterialTheme.colorScheme.onBackground) } ) } diff --git a/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/configuration/atoms/SortOptions.kt b/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/configuration/atoms/SortOptions.kt index 8430ae0eb..86ff9cc66 100644 --- a/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/configuration/atoms/SortOptions.kt +++ b/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/configuration/atoms/SortOptions.kt @@ -18,6 +18,7 @@ import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.dp import io.writeopia.common.utils.icons.WrIcons import io.writeopia.notemenu.ui.screen.configuration.modifier.icon +import io.writeopia.resources.WrStrings import io.writeopia.sdk.persistence.core.sorting.OrderBy import io.writeopia.theme.WrieopiaTheme import io.writeopia.theme.WriteopiaTheme @@ -63,7 +64,7 @@ internal fun SortOptions( leadingIcon = { Icon( imageVector = WrIcons.sortByName, - contentDescription = "Sort by name", + contentDescription = WrStrings.sortByName(), tint = iconTintColor ) }, @@ -71,7 +72,7 @@ internal fun SortOptions( selectSortOption(OrderBy.NAME) }, text = { - Text("Sort by name", color = MaterialTheme.colorScheme.onBackground) + Text(WrStrings.sortByName(), color = MaterialTheme.colorScheme.onBackground) } ) @@ -80,7 +81,7 @@ internal fun SortOptions( leadingIcon = { Icon( imageVector = WrIcons.sortByCreated, - contentDescription = "Sort by creation", + contentDescription = WrStrings.sortByCreation(), tint = iconTintColor ) }, @@ -88,7 +89,7 @@ internal fun SortOptions( selectSortOption(OrderBy.CREATE) }, text = { - Text("Sort by creation", color = MaterialTheme.colorScheme.onBackground) + Text(WrStrings.sortByCreation(), color = MaterialTheme.colorScheme.onBackground) } ) @@ -97,7 +98,7 @@ internal fun SortOptions( leadingIcon = { Icon( imageVector = WrIcons.sortByUpdate, - contentDescription = "Sort by last update", + contentDescription = WrStrings.sortByUpdate(), tint = iconTintColor ) }, @@ -106,7 +107,7 @@ internal fun SortOptions( }, text = { Text( - "Sort by last update", + WrStrings.sortByUpdate(), color = MaterialTheme.colorScheme.onBackground ) } diff --git a/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/configuration/molecules/ConfigurationsMenu.kt b/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/configuration/molecules/ConfigurationsMenu.kt index 5da59162a..27b4fe298 100644 --- a/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/configuration/molecules/ConfigurationsMenu.kt +++ b/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/configuration/molecules/ConfigurationsMenu.kt @@ -34,6 +34,7 @@ import io.writeopia.common.utils.icons.WrIcons import io.writeopia.commonui.SlideInBox import io.writeopia.commonui.options.slide.HorizontalOptions import io.writeopia.notemenu.ui.screen.configuration.modifier.orderConfigModifierHorizontal +import io.writeopia.resources.WrStrings import io.writeopia.sdk.persistence.core.sorting.OrderBy import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow @@ -156,12 +157,7 @@ private fun ArrangementSection( gridOptionClick: () -> Unit, listOptionClick: () -> Unit ) { - SectionText( - text = "Arrangement" -// stringResource( -// R.string.arrangement -// ) - ) + SectionText(text = WrStrings.arrangement()) ArrangementOptions( selected = selected, @@ -175,10 +171,7 @@ private fun ArrangementSection( private fun SortingSection(sortingSelected: (OrderBy) -> Unit, sortingState: StateFlow) { val order by sortingState.collectAsState() - SectionText( - text = "Sorting" -// stringResource(R.string.sorting) - ) + SectionText(text = WrStrings.sorting()) val optionStyle = MaterialTheme.typography.bodyMedium.copy( color = MaterialTheme.colorScheme.onPrimary, fontWeight = FontWeight.Bold @@ -204,7 +197,7 @@ private fun SortingSection(sortingSelected: (OrderBy) -> Unit, sortingState: Sta .background(background(OrderBy.UPDATE)) .clickable { sortingSelected(OrderBy.UPDATE) } .sortingOptionModifier(), - text = "Last updated", + text = WrStrings.lastUpdated(), // stringResource(R.string.last_updated) style = optionStyle, ) @@ -216,7 +209,7 @@ private fun SortingSection(sortingSelected: (OrderBy) -> Unit, sortingState: Sta .background(background(OrderBy.CREATE)) .clickable { sortingSelected(OrderBy.CREATE) } .sortingOptionModifier(), - text = "Create", + text = WrStrings.created(), // stringResource(R.string.last_created), style = optionStyle, ) @@ -228,7 +221,7 @@ private fun SortingSection(sortingSelected: (OrderBy) -> Unit, sortingState: Sta .background(background(OrderBy.NAME)) .clickable { sortingSelected(OrderBy.NAME) } .sortingOptionModifier(), - text = "Name", + text = WrStrings.sortByName(), // stringResource(R.string.name), style = optionStyle, ) diff --git a/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/documents/NoteItems.kt b/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/documents/NoteItems.kt index 6331a8e26..8f5b5f072 100644 --- a/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/documents/NoteItems.kt +++ b/application/features/note_menu/src/commonMain/kotlin/io/writeopia/notemenu/ui/screen/documents/NoteItems.kt @@ -64,6 +64,7 @@ import io.writeopia.commonui.dtos.MenuItemUi import io.writeopia.notemenu.data.model.NotesArrangement import io.writeopia.notemenu.ui.dto.NotesUi import io.writeopia.notemenu.utils.minimalNoteCardWidth +import io.writeopia.resources.WrStrings import io.writeopia.sdk.model.draganddrop.DropInfo import io.writeopia.sdk.models.story.StoryTypes import io.writeopia.theme.WriteopiaTheme @@ -718,22 +719,7 @@ private fun SharedTransitionScope.TapToStartButton( .clip(MaterialTheme.shapes.large) .clickable(onClick = newNote) ) { - val text = buildAnnotatedString { - append("Tap here to ") - pushStyle( - SpanStyle( - color = MaterialTheme.colorScheme.primary, - fontStyle = FontStyle.Italic, - fontWeight = FontWeight.Bold - ) - ) - - append("write") - - pop() - - append(" the next big thing") - } + val text = WrStrings.tapToStart() Text( text = text, diff --git a/application/features/notifications/build.gradle.kts b/application/features/notifications/build.gradle.kts index 952fc80c6..c4512c2e2 100644 --- a/application/features/notifications/build.gradle.kts +++ b/application/features/notifications/build.gradle.kts @@ -45,8 +45,6 @@ kotlin { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material3) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) implementation(libs.compose.navigation) } } diff --git a/application/features/notifications/config/ktlint/baseline.xml b/application/features/notifications/config/ktlint/baseline.xml index 1c00fcd1f..981420778 100644 --- a/application/features/notifications/config/ktlint/baseline.xml +++ b/application/features/notifications/config/ktlint/baseline.xml @@ -1,151 +1,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/application/features/search/build.gradle.kts b/application/features/search/build.gradle.kts index bac8f1dcc..79a271b14 100644 --- a/application/features/search/build.gradle.kts +++ b/application/features/search/build.gradle.kts @@ -40,8 +40,9 @@ kotlin { implementation(project(":application:core:theme")) implementation(project(":application:core:models")) implementation(project(":application:core:folders")) - implementation(project(":application:features:note_menu")) implementation(project(":application:core:utils")) + implementation(project(":application:core:resources")) + implementation(project(":application:features:note_menu")) implementation(project(":plugins:writeopia_persistence_core")) implementation(project(":plugins:writeopia_persistence_sqldelight")) @@ -51,8 +52,6 @@ kotlin { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material3) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) implementation(libs.compose.navigation) implementation(libs.lifecycle.viewmodel.compose) } diff --git a/application/features/search/config/ktlint/baseline.xml b/application/features/search/config/ktlint/baseline.xml index 35d5165e8..981420778 100644 --- a/application/features/search/config/ktlint/baseline.xml +++ b/application/features/search/config/ktlint/baseline.xml @@ -1,151 +1,3 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/application/features/search/src/commonMain/kotlin/io/writeopia/features/search/ui/SearchDialog.kt b/application/features/search/src/commonMain/kotlin/io/writeopia/features/search/ui/SearchDialog.kt index d2881e866..0d771a633 100644 --- a/application/features/search/src/commonMain/kotlin/io/writeopia/features/search/ui/SearchDialog.kt +++ b/application/features/search/src/commonMain/kotlin/io/writeopia/features/search/ui/SearchDialog.kt @@ -34,6 +34,7 @@ import androidx.compose.ui.window.DialogProperties import io.writeopia.common.utils.icons.WrIcons import io.writeopia.features.search.repository.SearchItem import io.writeopia.notemenu.data.model.NotesNavigation +import io.writeopia.resources.WrStrings import io.writeopia.theme.WriteopiaTheme import kotlinx.coroutines.flow.StateFlow @@ -98,7 +99,7 @@ fun SearchScreen( if (search.isEmpty()) { Text( - text = "Recent", + text = WrStrings.recent(), color = WriteopiaTheme.colorScheme.textLighter, style = MaterialTheme.typography.bodySmall, modifier = Modifier.padding(horizontal = 10.dp), @@ -184,7 +185,7 @@ fun SearchInput(search: String, onSearchType: (String) -> Unit, modifier: Modifi ) { Icon( imageVector = WrIcons.search, - contentDescription = "Search", + contentDescription = WrStrings.search(), tint = MaterialTheme.colorScheme.onBackground ) @@ -201,7 +202,7 @@ fun SearchInput(search: String, onSearchType: (String) -> Unit, modifier: Modifi ) if (search.isEmpty()) { - Text("Search") + Text(WrStrings.search()) } } diff --git a/tutorials/config/ktlint/baseline.xml b/tutorials/config/ktlint/baseline.xml new file mode 100644 index 000000000..981420778 --- /dev/null +++ b/tutorials/config/ktlint/baseline.xml @@ -0,0 +1,3 @@ + + + diff --git a/writeopia_documents/Welcome!_816lZJxpi9.json b/writeopia_documents/Welcome!_816lZJxpi9.json index e54356524..80482fe76 100644 --- a/writeopia_documents/Welcome!_816lZJxpi9.json +++ b/writeopia_documents/Welcome!_816lZJxpi9.json @@ -10,13 +10,6 @@ "number": 11 }, "text": "Welcome!", - "spans": [ - { - "start": 0, - "end": 0, - "span": "BOLD" - } - ], "decoration": { "backgroundColor": -7829368 }, @@ -190,11 +183,11 @@ } ], "createdAt": 1739622940593, - "lastUpdatedAt": 1739783259799, + "lastUpdatedAt": 1739964086214, "parentId": "root", "isLocked": false, "icon": { "label": "home", "tint": -65281 } -} +} \ No newline at end of file diff --git a/writeopia_documents/writeopia_config_file.json b/writeopia_documents/writeopia_config_file.json index f441957d2..ebf451ef8 100644 --- a/writeopia_documents/writeopia_config_file.json +++ b/writeopia_documents/writeopia_config_file.json @@ -1,3 +1,3 @@ { - "lastUpdateTable": 1739960766634 + "lastUpdateTable": 1739981348335 } \ No newline at end of file diff --git a/writeopia_ui/build.gradle.kts b/writeopia_ui/build.gradle.kts index b5f00682f..4f83f87fc 100644 --- a/writeopia_ui/build.gradle.kts +++ b/writeopia_ui/build.gradle.kts @@ -85,7 +85,6 @@ kotlin { implementation(compose.foundation) implementation(compose.material3) implementation(compose.materialIconsExtended) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) implementation(compose.components.resources) implementation(compose.components.uiToolingPreview) diff --git a/writeopia_ui/src/commonMain/composeResources/values-en/strings.xml b/writeopia_ui/src/commonMain/composeResources/values-en/strings.xml new file mode 100644 index 000000000..fa60f66d6 --- /dev/null +++ b/writeopia_ui/src/commonMain/composeResources/values-en/strings.xml @@ -0,0 +1,3 @@ + + Title + diff --git a/writeopia_ui/src/commonMain/composeResources/values-pt/strings.xml b/writeopia_ui/src/commonMain/composeResources/values-pt/strings.xml new file mode 100644 index 000000000..8b5ec6b10 --- /dev/null +++ b/writeopia_ui/src/commonMain/composeResources/values-pt/strings.xml @@ -0,0 +1,3 @@ + + Título + diff --git a/writeopia_ui/src/commonMain/composeResources/values/strings.xml b/writeopia_ui/src/commonMain/composeResources/values/strings.xml new file mode 100644 index 000000000..fa60f66d6 --- /dev/null +++ b/writeopia_ui/src/commonMain/composeResources/values/strings.xml @@ -0,0 +1,3 @@ + + Title + diff --git a/writeopia_ui/src/commonMain/kotlin/io/writeopia/ui/drawer/content/HeaderDrawer.kt b/writeopia_ui/src/commonMain/kotlin/io/writeopia/ui/drawer/content/HeaderDrawer.kt index f850c190f..5b985ba28 100644 --- a/writeopia_ui/src/commonMain/kotlin/io/writeopia/ui/drawer/content/HeaderDrawer.kt +++ b/writeopia_ui/src/commonMain/kotlin/io/writeopia/ui/drawer/content/HeaderDrawer.kt @@ -43,7 +43,6 @@ import io.writeopia.sdk.models.story.StoryTypes import io.writeopia.ui.drawer.SimpleTextDrawer import io.writeopia.ui.drawer.StoryStepDrawer import io.writeopia.ui.drawer.factory.EndOfText -import io.writeopia.ui.icons.WrSdkIcons import io.writeopia.ui.manager.WriteopiaStateManager import io.writeopia.ui.model.DrawConfig import io.writeopia.ui.model.DrawInfo @@ -51,7 +50,10 @@ import io.writeopia.ui.model.EmptyErase import io.writeopia.ui.utils.transparentTextInputColors import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow +import org.jetbrains.compose.resources.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview +import writeopia.writeopia_ui.generated.resources.Res +import writeopia.writeopia_ui.generated.resources.title /** * The header for the Document. It applies some stylish to the title of the document. @@ -132,7 +134,7 @@ class HeaderDrawer( interactionSource = interactionSource, placeholder = { Text( - text = "Title", + text = stringResource(Res.string.title), style = placeHolderStyle(), ) },