tauri-plugin-widgets 0.5.0

Tauri plugin for App Widgets on Android, iOS, and macOS (WidgetKit); Windows Widgets Board (Adaptive Cards) + desktop webview; Linux desktop webview with X11 DESKTOP pin.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package git.s00d.widgets

object WidgetSanitizer {
    private val allowed = Regex("[^A-Za-z0-9._:-]")

    fun sanitizeGroup(group: String, fallback: String): String {
        val clean = group.trim().replace(Regex("[^A-Za-z0-9._-]"), "_")
        return if (clean.isNotEmpty()) clean else fallback
    }

    fun sanitizeKey(key: String): String {
        val clean = key.trim().replace(allowed, "_")
        return clean.ifEmpty { "_" }
    }
}