diff --git a/.gitignore b/.gitignore index 07a4d4b..94cfc4d 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,12 @@ secrets.key *.pem *.key *.p12 +*.keystore + +# Android build outputs +.gradle/ +android/**/build/ +android/.gradle/ # Test-Output und Coverage-Reports coverage/ diff --git a/android/app/build.gradle b/android/app/build.gradle new file mode 100644 index 0000000..ead8e9e --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,103 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' + id 'org.jetbrains.kotlin.plugin.compose' +} + +android { + namespace 'de.orfel.mindomat' + compileSdk 35 + + defaultConfig { + applicationId "de.orfel.mindomat" + minSdk 26 + targetSdk 35 + versionCode 1 + versionName "1.0.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables { + useSupportLibrary true + } + } + + signingConfigs { + debug { + storeFile file('debug.keystore') + storePassword 'android' + keyAlias 'androiddebugkey' + keyPassword 'android' + } + release { + storeFile file('../mindomat-upload-key.keystore') + storePassword '#M1nd0M4t2026!' + keyAlias 'mindomat-alias' + keyPassword '#M1nd0M4t2026!' + } + } + + buildTypes { + debug { + signingConfig signingConfigs.debug + } + release { + signingConfig signingConfigs.release + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = '17' + } + + buildFeatures { + compose true + } + + packaging { + resources { + excludes += '/META-INF/{AL2.0,LGPL2.1}' + } + } +} + +dependencies { + implementation 'androidx.core:core-ktx:1.13.1' + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.6' + implementation 'androidx.activity:activity-compose:1.9.3' + + // Jetpack Compose + implementation platform('androidx.compose:compose-bom:2024.10.00') + implementation 'androidx.compose.ui:ui' + implementation 'androidx.compose.ui:ui-graphics' + implementation 'androidx.compose.ui:ui-tooling-preview' + implementation 'androidx.compose.material3:material3' + implementation 'androidx.compose.material:material-icons-extended' + + // Navigation + implementation 'androidx.navigation:navigation-compose:2.8.3' + + // Networking + implementation 'com.squareup.okhttp3:okhttp:4.12.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' + + // JSON + implementation 'org.json:json:20240303' + + // ViewModel + implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.8.6' + + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1' + androidTestImplementation platform('androidx.compose:compose-bom:2024.10.00') + androidTestImplementation 'androidx.compose.ui:ui-test-junit4' + debugImplementation 'androidx.compose.ui:ui-tooling' + debugImplementation 'androidx.compose.ui:ui-test-manifest' +} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..2714f1c --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/java/de/jannik/mindomat/data/Models.kt b/android/app/src/main/java/de/jannik/mindomat/data/Models.kt new file mode 100644 index 0000000..7a0172b --- /dev/null +++ b/android/app/src/main/java/de/jannik/mindomat/data/Models.kt @@ -0,0 +1,42 @@ +package de.jannik.mindomat.data + +data class NoteSummary( + val id: String, + val title: String, + val folder: String, + val tags: List, + val snippet: String, + val lastModified: String +) + +data class NoteDetail( + val id: String, + val content: String, + val frontmatter: Map, + val lastModified: String +) + +data class CaptureRequest( + val text: String, + val title: String? = null, + val tags: List = emptyList(), + val autoIngest: Boolean = true, + val autoSync: Boolean = true, + val targetFolder: String = "00_Inbox" +) + +data class CaptureResponse( + val ok: Boolean, + val noteId: String, + val title: String, + val ingested: Boolean, + val synced: Boolean, + val message: String +) + +data class ServerStatus( + val ok: Boolean, + val name: String, + val version: String, + val authRequired: Boolean +) diff --git a/android/app/src/main/java/de/jannik/mindomat/data/SettingsRepository.kt b/android/app/src/main/java/de/jannik/mindomat/data/SettingsRepository.kt new file mode 100644 index 0000000..794d83e --- /dev/null +++ b/android/app/src/main/java/de/jannik/mindomat/data/SettingsRepository.kt @@ -0,0 +1,39 @@ +package de.jannik.mindomat.data + +import android.content.Context +import android.content.SharedPreferences + +class SettingsRepository(context: Context) { + private val prefs: SharedPreferences = + context.getSharedPreferences("mindomat_prefs", Context.MODE_PRIVATE) + + var serverUrl: String + get() = prefs.getString(KEY_SERVER_URL, DEFAULT_SERVER_URL) ?: DEFAULT_SERVER_URL + set(value) = prefs.edit().putString(KEY_SERVER_URL, value.trim().trimEnd('/')).apply() + + var apiToken: String + get() = prefs.getString(KEY_API_TOKEN, "") ?: "" + set(value) = prefs.edit().putString(KEY_API_TOKEN, value.trim()).apply() + + var autoIngest: Boolean + get() = prefs.getBoolean(KEY_AUTO_INGEST, true) + set(value) = prefs.edit().putBoolean(KEY_AUTO_INGEST, value).apply() + + var autoSync: Boolean + get() = prefs.getBoolean(KEY_AUTO_SYNC, true) + set(value) = prefs.edit().putBoolean(KEY_AUTO_SYNC, value).apply() + + var defaultFolder: String + get() = prefs.getString(KEY_DEFAULT_FOLDER, "00_Inbox") ?: "00_Inbox" + set(value) = prefs.edit().putString(KEY_DEFAULT_FOLDER, value).apply() + + companion object { + private const val KEY_SERVER_URL = "server_url" + private const val KEY_API_TOKEN = "api_token" + private const val KEY_AUTO_INGEST = "auto_ingest" + private const val KEY_AUTO_SYNC = "auto_sync" + private const val KEY_DEFAULT_FOLDER = "default_folder" + + const val DEFAULT_SERVER_URL = "https://mindomat.orfel.de" + } +} diff --git a/android/app/src/main/java/de/jannik/mindomat/ui/theme/Color.kt b/android/app/src/main/java/de/jannik/mindomat/ui/theme/Color.kt new file mode 100644 index 0000000..1b40975 --- /dev/null +++ b/android/app/src/main/java/de/jannik/mindomat/ui/theme/Color.kt @@ -0,0 +1,20 @@ +package de.jannik.mindomat.ui.theme + +import androidx.compose.ui.graphics.Color + +val DarkHeader = Color(0xFF222222) +val MintGreen = Color(0xFF5AD8A6) +val MintGreenDark = Color(0xFF389E73) +val BackgroundLight = Color(0xFFF8F9FA) +val SurfaceWhite = Color(0xFFFFFFFF) +val TextPrimary = Color(0xFF1E2022) +val TextSecondary = Color(0xFF686D76) +val BorderColor = Color(0xFFE0E0E0) +val MicRed = Color(0xFFE53935) + +// Folder Badge Colors +val FolderInbox = Color(0xFFF6C343) +val FolderWiki = Color(0xFF5AD8A6) +val FolderDaily = Color(0xFF5B8FF9) +val FolderProjects = Color(0xFF9270CA) +val FolderOther = Color(0xFF8C8C8C) diff --git a/android/app/src/main/java/de/jannik/mindomat/ui/theme/Theme.kt b/android/app/src/main/java/de/jannik/mindomat/ui/theme/Theme.kt new file mode 100644 index 0000000..6c67752 --- /dev/null +++ b/android/app/src/main/java/de/jannik/mindomat/ui/theme/Theme.kt @@ -0,0 +1,28 @@ +package de.jannik.mindomat.ui.theme + +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable + +private val LightColorScheme = lightColorScheme( + primary = MintGreen, + onPrimary = SurfaceWhite, + primaryContainer = MintGreenDark, + secondary = DarkHeader, + onSecondary = SurfaceWhite, + background = BackgroundLight, + surface = SurfaceWhite, + onBackground = TextPrimary, + onSurface = TextPrimary, + outline = BorderColor +) + +@Composable +fun MindomatTheme( + content: @Composable () -> Unit +) { + MaterialTheme( + colorScheme = LightColorScheme, + content = content + ) +} diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..3941bea --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..3941bea --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..6e265c1 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..855b4e7 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..a7b6e7e Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..2e8a1e1 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..f614635 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..14fa2a2 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..cd4efd1 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..1fbbd36 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1591350 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..7316e1a Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..a048670 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..8fe075b Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..0336e8a Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp new file mode 100644 index 0000000..7d43d86 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..5477126 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..bfb8945 --- /dev/null +++ b/android/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + #5AD8A6 + diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..bfc1562 --- /dev/null +++ b/android/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + Mind-o-Mat + diff --git a/android/app/src/main/res/values/themes.xml b/android/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..1d7963e --- /dev/null +++ b/android/app/src/main/res/values/themes.xml @@ -0,0 +1,6 @@ + + + diff --git a/android/app/src/main/res/xml/backup_rules.xml b/android/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 0000000..45845c3 --- /dev/null +++ b/android/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,4 @@ + + + + diff --git a/android/app/src/main/res/xml/data_extraction_rules.xml b/android/app/src/main/res/xml/data_extraction_rules.xml new file mode 100644 index 0000000..9e2c689 --- /dev/null +++ b/android/app/src/main/res/xml/data_extraction_rules.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..32793c3 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,10 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + id 'com.android.application' version '8.5.2' apply false + id 'org.jetbrains.kotlin.android' version '2.0.21' apply false + id 'org.jetbrains.kotlin.plugin.compose' version '2.0.21' apply false +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..4f93ccc --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m +android.useAndroidX=true +android.nonTransitiveRClass=true +kotlin.code.style=official diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..1b33c55 Binary files /dev/null and b/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..d4081da --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/android/gradlew b/android/gradlew new file mode 100644 index 0000000..7f94d3d --- /dev/null +++ b/android/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH="\\\"\\\"" + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/android/gradlew.bat b/android/gradlew.bat new file mode 100644 index 0000000..db3a6ac --- /dev/null +++ b/android/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH= + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000..86d5bb9 --- /dev/null +++ b/android/settings.gradle @@ -0,0 +1,23 @@ +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "Mindomat" +include ':app' diff --git a/entrypoint.sh b/entrypoint.sh index ab67956..ec1d275 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -16,7 +16,17 @@ if command -v git >/dev/null 2>&1; then git -C "$VAULT_DIR" config user.name "Mind-o-Mat Server" 2>/dev/null || true git -C "$VAULT_DIR" config user.email "mindomat@orfel.de" 2>/dev/null || true echo "[Git] Pulling latest changes from remote..." - (cd "$VAULT_DIR" && git pull --ff-only 2>/dev/null) || echo "[Git] Git pull skipped or offline" + (cd "$VAULT_DIR" && git pull --ff-only 2>/dev/null) || (cd "$VAULT_DIR" && git fetch origin main 2>/dev/null && git reset --hard origin/main 2>/dev/null) || echo "[Git] Git pull skipped or offline" + elif [ -n "$VAULT_SYNC_TOKEN" ]; then + echo "[Git] Vault hat kein .git-Verzeichnis. Initialisiere aus Remote..." + rm -rf /tmp/initial_vault 2>/dev/null || true + if git clone "https://${VAULT_SYNC_TOKEN}@git.orfel.de/Jannik/Mind-o-Mat-Vault.git" /tmp/initial_vault 2>/dev/null; then + cp -a /tmp/initial_vault/. "$VAULT_DIR"/ + rm -rf /tmp/initial_vault + echo "[Git] Vault erfolgreich geklont nach $VAULT_DIR" + else + echo "[Git] Initiales Klonen fehlgeschlagen" + fi fi fi diff --git a/server.mjs b/server.mjs index 2fc3e04..219ce8e 100644 --- a/server.mjs +++ b/server.mjs @@ -148,25 +148,141 @@ app.get('/note', (req, res) => { // 3. Notes API -// GET /api/notes -> Liste aller Notiz-Pfade +// 2b. Status / Ping Route für Verbindungstests (z. B. aus Android-App) +app.get('/api/status', (_req, res) => { + res.json({ + ok: true, + name: 'Mind-o-Mat', + version: '1.0.0', + authRequired: !!NOTES_API_TOKEN, + }); +}); + +// 3. Notes API + +// GET /api/notes -> Liste aller Notiz-Pfade + Metadaten app.get('/api/notes', checkAuth, (_req, res) => { try { const notes = []; + const items = []; const dirs = ['00_Inbox', '10_Wiki/Seiten', '01_Daily', '20_Projekte']; for (const d of dirs) { const full = join(VAULT_PATH, d); if (!existsSync(full)) continue; const files = readdirSync(full).filter((f) => f.endsWith('.md')); for (const f of files) { - notes.push(join(d, f).replace(/\\/g, '/')); + const id = join(d, f).replace(/\\/g, '/'); + notes.push(id); + try { + const raw = readFileSync(join(full, f), 'utf-8'); + const parsed = matter(raw); + const title = + parsed.data?.title || + raw.match(/^#\s+(.+)$/m)?.[1] || + f.replace(/\.md$/, ''); + const tags = Array.isArray(parsed.data?.tags) ? parsed.data.tags.map(String) : []; + const cleanContent = raw.replace(/^---[\s\S]*?---/, '').trim(); + const snippet = cleanContent.slice(0, 160).replace(/\s+/g, ' '); + items.push({ + id, + title, + folder: d, + tags, + snippet, + lastModified: new Date().toISOString(), + }); + } catch { + items.push({ id, title: f, folder: d, tags: [], snippet: '', lastModified: '' }); + } } } - res.json({ notes }); + res.json({ notes, items }); } catch (err) { res.status(500).json({ error: err.message }); } }); +// POST /api/capture -> Quick Capture Notiz mit optionalem Ingest & Sync +app.post('/api/capture', checkAuth, express.json({ limit: '10mb' }), async (req, res) => { + try { + const { text, title, tags, autoIngest = true, autoSync = true, targetFolder = '00_Inbox' } = req.body || {}; + if (!text || typeof text !== 'string' || !text.trim()) { + res.status(400).json({ ok: false, error: 'Text darf nicht leer sein' }); + return; + } + + const now = new Date(); + const dateStr = now.toISOString().slice(0, 10); + const firstLine = text.trim().split('\n')[0] || ''; + const rawTitle = title?.trim() || firstLine.replace(/^[#\s*-_]+/, '').slice(0, 40).trim() || 'Notiz'; + const cleanTitle = rawTitle.replace(/[^a-zA-Z0-9äöüÄÖÜß\-_ ]/g, '').trim() || 'Notiz'; + const safeFilenameTitle = cleanTitle.replace(/\s+/g, '_'); + const timeStr = `${String(now.getHours()).padStart(2, '0')}${String(now.getMinutes()).padStart(2, '0')}${String(now.getSeconds()).padStart(2, '0')}`; + const filename = `${dateStr}_${safeFilenameTitle}_${timeStr}.md`; + const noteId = `${targetFolder}/${filename}`; + const notePath = join(VAULT_PATH, noteId); + + const tagsArray = Array.isArray(tags) && tags.length > 0 ? tags : ['capture']; + const tagsYaml = `tags: [${tagsArray.join(', ')}]`; + const bodyContent = text.startsWith('#') ? text : `# ${cleanTitle}\n\n${text}`; + const fullContent = `--- +title: "${cleanTitle}" +created: ${dateStr} +aktualisiert: ${dateStr} +${tagsYaml} +--- + +${bodyContent} +`; + + mkdirSync(join(notePath, '..'), { recursive: true }); + writeFileSync(notePath, fullContent, 'utf-8'); + + // Index aktualisieren + triggerIndex(); + + let ingested = false; + let synced = false; + + // Optionaler Ingest + if (autoIngest && existsSync(TOOL_BIN_PATH)) { + try { + spawnSync('node', [TOOL_BIN_PATH, 'ingest', '--vault', VAULT_PATH, '--note', notePath], { + stdio: 'pipe', + timeout: 30000, + }); + ingested = true; + } catch (e) { + console.error('[Capture] Ingest Fehler:', e.message); + } + } + + // Optionaler Sync + if (autoSync && existsSync(TOOL_BIN_PATH)) { + try { + const syncProc = spawnSync('node', [TOOL_BIN_PATH, 'sync', '--vault', VAULT_PATH], { + stdio: 'pipe', + timeout: 30000, + }); + synced = syncProc.status === 0; + } catch (e) { + console.error('[Capture] Sync Fehler:', e.message); + } + } + + res.json({ + ok: true, + noteId, + title: cleanTitle, + ingested, + synced, + message: 'Notiz erfolgreich erfasst', + }); + } catch (err) { + res.status(500).json({ ok: false, error: err.message }); + } +}); + // GET /api/notes/ -> Einzelne Notiz lesen app.get(/^\/api\/notes\/(.+)$/, checkAuth, (req, res) => { try { diff --git a/src/notes-api-server.ts b/src/notes-api-server.ts index cad7fc9..714641e 100644 --- a/src/notes-api-server.ts +++ b/src/notes-api-server.ts @@ -14,6 +14,32 @@ export interface NoteData { lastModified: string; } +export interface NoteSummary { + id: string; + title: string; + folder: string; + tags: string[]; + lastModified: string; + snippet: string; +} + +export interface CaptureRequest { + text: string; + title?: string; + tags?: string[]; + autoIngest?: boolean; + autoSync?: boolean; + targetFolder?: string; +} + +export interface CaptureResult { + ok: boolean; + noteId: string; + title: string; + content: string; + message: string; +} + export interface SyncResult { ok: boolean; message: string; @@ -122,6 +148,72 @@ export class NotesApi { }; } + listNotesWithMetadata(): NoteSummary[] { + const noteIds = this.listNotes(); + const result: NoteSummary[] = []; + for (const id of noteIds) { + const note = this.getNote(id); + if (!note) continue; + const folder = id.split('/')[0] || ''; + const frontmatter = note.frontmatter || {}; + const title = + (frontmatter.title as string) || + note.content.match(/^#\s+(.+)$/m)?.[1] || + id.split('/').pop()?.replace(/\.md$/, '') || + 'Ohne Titel'; + const rawTags = frontmatter.tags; + const tags = Array.isArray(rawTags) ? rawTags.map(String) : []; + const cleanContent = note.content.replace(/^---[\s\S]*?---/, '').trim(); + const snippet = cleanContent.slice(0, 160).replace(/\s+/g, ' '); + result.push({ + id, + title, + folder, + tags, + lastModified: note.lastModified, + snippet, + }); + } + return result; + } + + captureNote(req: CaptureRequest): CaptureResult { + const folder = req.targetFolder || '00_Inbox'; + const now = new Date(); + const dateStr = now.toISOString().slice(0, 10); + const firstLine = req.text.trim().split('\n')[0] || ''; + const rawTitle = + req.title?.trim() || + firstLine.replace(/^[#\s*-_]+/, '').slice(0, 40).trim() || + 'Notiz'; + const cleanTitle = rawTitle.replace(/[^a-zA-Z0-9äöüÄÖÜß\-_ ]/g, '').trim() || 'Notiz'; + const safeFilenameTitle = cleanTitle.replace(/\s+/g, '_'); + const timeStr = `${String(now.getHours()).padStart(2, '0')}${String(now.getMinutes()).padStart(2, '0')}${String(now.getSeconds()).padStart(2, '0')}`; + const filename = `${dateStr}_${safeFilenameTitle}_${timeStr}.md`; + const noteId = `${folder}/${filename}`; + + const tagsArray = req.tags && req.tags.length > 0 ? req.tags : ['capture']; + const tagsYaml = `tags: [${tagsArray.join(', ')}]`; + const bodyContent = req.text.startsWith('#') ? req.text : `# ${cleanTitle}\n\n${req.text}`; + const content = `--- +title: "${cleanTitle}" +created: ${dateStr} +aktualisiert: ${dateStr} +${tagsYaml} +--- + +${bodyContent} +`; + this.saveNote(noteId, content); + return { + ok: true, + noteId, + title: cleanTitle, + content, + message: 'Notiz erfolgreich gespeichert', + }; + } + syncVault(toolBinaryPath: string): Promise { return new Promise((resolve) => { const child = spawn('node', [toolBinaryPath, 'sync', '--vault', this.vaultPath], { diff --git a/tests/notes-api.test.ts b/tests/notes-api.test.ts index 664954e..d4c77ea 100644 --- a/tests/notes-api.test.ts +++ b/tests/notes-api.test.ts @@ -183,4 +183,39 @@ describe('NotesApi End-to-End', () => { expect(updated!.frontmatter.title).toBe('Wiki X (updated)'); expect(updated!.content).toContain('# Updated'); }); + + it('listNotesWithMetadata liefert Notizen mit Titeln, Tags und Ordnern', () => { + const vault = setupVault({ + '00_Inbox/2026-09-08_Idee.md': '---\ntitle: Coole Idee\ntags: [app, mobile]\n---\n\n# Coole Idee\n\nDas ist der Snippet-Text.', + }); + vaults.push(vault); + const api = new NotesApi(vault); + const items = api.listNotesWithMetadata(); + expect(items.length).toBe(1); + expect(items[0].title).toBe('Coole Idee'); + expect(items[0].folder).toBe('00_Inbox'); + expect(items[0].tags).toEqual(['app', 'mobile']); + expect(items[0].snippet).toContain('Das ist der Snippet-Text.'); + }); + + it('captureNote legt Notiz in 00_Inbox mit Frontmatter an', () => { + const vault = setupVault(); + vaults.push(vault); + const api = new NotesApi(vault); + const result = api.captureNote({ + text: 'Meeting mit Anna morgen um 10 Uhr', + title: 'Meeting Anna', + tags: ['meeting', 'arbeit'], + }); + + expect(result.ok).toBe(true); + expect(result.noteId).toMatch(/^00_Inbox\/\d{4}-\d{2}-\d{2}_Meeting_Anna_\d+\.md$/); + expect(existsSync(join(vault, result.noteId))).toBe(true); + + const saved = api.getNote(result.noteId); + expect(saved).not.toBeNull(); + expect(saved!.frontmatter.title).toBe('Meeting Anna'); + expect(saved!.content).toContain('Meeting mit Anna morgen um 10 Uhr'); + }); }); + diff --git a/webapp/src/NewNoteDialog.tsx b/webapp/src/NewNoteDialog.tsx index bd53f2a..e3bddcc 100644 --- a/webapp/src/NewNoteDialog.tsx +++ b/webapp/src/NewNoteDialog.tsx @@ -1,14 +1,19 @@ // Neue Notiz erstellen -// Bonus: einfacher Workflow, damit Notizen ohne cmd erstellt werden koennen +// Mit Web Speech API (Spracherkennung auf Deutsch) und 1-Klick Auto-Sync zu Git -import { useState } from 'react'; -import { saveNote } from './notes-api'; +import { useState, useEffect, useRef } from 'react'; +import { saveNote, captureNote } from './notes-api'; interface Props { onClose: () => void; onCreated: (noteId: string) => void; } +interface IWindow extends Window { + SpeechRecognition?: any; + webkitSpeechRecognition?: any; +} + function todayString(): string { return new Date().toISOString().slice(0, 10); } @@ -18,40 +23,136 @@ export default function NewNoteDialog({ onClose, onCreated }: Props) { const [body, setBody] = useState(''); const [tags, setTags] = useState('notiz'); const [inbox, setInbox] = useState(true); + const [autoSync, setAutoSync] = useState(true); const [saving, setSaving] = useState(false); const [error, setError] = useState(null); + // Spracherkennung (Web Speech API) + const [isListening, setIsListening] = useState(false); + const [speechSupported, setSpeechSupported] = useState(false); + const recognitionRef = useRef(null); + + useEffect(() => { + const win = window as unknown as IWindow; + const hasSpeech = !!(win.SpeechRecognition || win.webkitSpeechRecognition); + setSpeechSupported(hasSpeech); + + return () => { + if (recognitionRef.current) { + try { + recognitionRef.current.stop(); + } catch { + // ignore + } + } + }; + }, []); + + const toggleListening = () => { + if (isListening) { + try { + recognitionRef.current?.stop(); + } catch { + // ignore + } + setIsListening(false); + return; + } + + const win = window as unknown as IWindow; + const SpeechRec = win.SpeechRecognition || win.webkitSpeechRecognition; + if (!SpeechRec) { + setError('Spracherkennung wird in diesem Browser nicht unterstützt.'); + return; + } + + try { + const recognition = new SpeechRec(); + recognition.lang = 'de-DE'; + recognition.continuous = true; + recognition.interimResults = true; + + recognition.onresult = (event: any) => { + let finalTranscript = ''; + for (let i = event.resultIndex; i < event.results.length; ++i) { + if (event.results[i].isFinal) { + finalTranscript += event.results[i][0].transcript + ' '; + } + } + if (finalTranscript) { + setBody((prev) => (prev ? `${prev.trim()} ${finalTranscript.trim()}` : finalTranscript.trim())); + if (!title) { + const words = finalTranscript.trim().split(' ').slice(0, 5).join(' '); + setTitle(words); + } + } + }; + + recognition.onerror = (evt: any) => { + console.error('Speech recognition error:', evt); + setIsListening(false); + }; + + recognition.onend = () => { + setIsListening(false); + }; + + recognitionRef.current = recognition; + recognition.start(); + setIsListening(true); + setError(null); + } catch (err) { + console.error('Failed to start speech recognition:', err); + setIsListening(false); + setError('Konnte Mikrofon nicht aktivieren'); + } + }; + const handleSave = async () => { - if (!title.trim()) { - setError('Titel darf nicht leer sein'); + if (!title.trim() && !body.trim()) { + setError('Bitte Titel oder Inhalt eingeben'); return; } setSaving(true); setError(null); + + const tagsArray = tags + .split(',') + .map((t) => t.trim()) + .filter(Boolean); + try { - const date = todayString(); - const tagsArray = tags - .split(',') - .map((t) => t.trim()) - .filter(Boolean); - const tagLine = tagsArray.length > 0 ? `tags: [${tagsArray.join(', ')}]\n` : ''; - const fullBody = body.startsWith('#') ? body : title + '\n\n' + body; - const content = `--- -title: ${title} + if (autoSync) { + const res = await captureNote({ + text: body || title, + title: title || undefined, + tags: tagsArray, + autoIngest: inbox, + autoSync: true, + targetFolder: inbox ? '00_Inbox' : '01_Daily', + }); + onCreated(res.noteId); + onClose(); + } else { + const date = todayString(); + const tagLine = tagsArray.length > 0 ? `tags: [${tagsArray.join(', ')}]\n` : ''; + const effectiveTitle = title || body.slice(0, 30); + const fullBody = body.startsWith('#') ? body : effectiveTitle + '\n\n' + body; + const content = `--- +title: "${effectiveTitle}" created: ${date} aktualisiert: ${date} ${tagLine}--- ${fullBody} `; - // Wenn in 00_Inbox/, dann vom Watcher spaeter verarbeitet - // Sonst direkt in 01_Daily/ als "fertige" Notiz - const noteId = inbox - ? `00_Inbox/${date}_${title.replace(/[^a-zA-Z0-9]/g, '_')}.md` - : `01_Daily/${date}_${title.replace(/[^a-zA-Z0-9]/g, '_')}.md`; - await saveNote(noteId, content); - onCreated(noteId); - onClose(); + const noteId = inbox + ? `00_Inbox/${date}_${effectiveTitle.replace(/[^a-zA-Z0-9]/g, '_')}.md` + : `01_Daily/${date}_${effectiveTitle.replace(/[^a-zA-Z0-9]/g, '_')}.md`; + await saveNote(noteId, content); + onCreated(noteId); + onClose(); + } } catch (err) { setError((err as Error).message); setSaving(false); @@ -85,22 +186,46 @@ ${fullBody} boxShadow: '0 4px 20px rgba(0,0,0,0.3)', }} > -

Neue Notiz

+
+

Neue Notiz erfassen

+ {speechSupported && ( + + )} +
setTitle(e.target.value)} - placeholder="z. B. Erste Notiz" + placeholder="z. B. Besprechung mit Max" autoFocus style={{ width: '100%', padding: 8, - fontSize: 16, + fontSize: 15, border: '1px solid #ccc', borderRadius: 4, boxSizing: 'border-box', @@ -110,19 +235,19 @@ ${fullBody}