@seelen-ui/lib 2.4.6 → 2.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +23 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common16.js +51 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common32.d.ts +35 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common32.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common32.js +192 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_validate_binary_like.d.ts +2 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_validate_binary_like.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_validate_binary_like.js +26 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/ascii85.d.ts +61 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/ascii85.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/ascii85.js +152 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base32.d.ts +40 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base32.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base32.js +87 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base58.d.ts +40 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base58.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base58.js +131 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts +40 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.js +82 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +39 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/hex.js +87 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/mod.d.ts +98 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/mod.js +99 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/varint.d.ts +120 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/varint.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/encoding/1.0.10/varint.js +205 -0
- package/esm/gen/types/AppExtraFlag.d.ts +6 -5
- package/esm/gen/types/AppExtraFlag.d.ts.map +1 -1
- package/esm/gen/types/AppExtraFlag.js +6 -5
- package/esm/gen/types/FancyToolbarSettings.d.ts +0 -8
- package/esm/gen/types/FancyToolbarSettings.d.ts.map +1 -1
- package/esm/gen/types/FocusedApp.d.ts +6 -0
- package/esm/gen/types/FocusedApp.d.ts.map +1 -1
- package/esm/gen/types/SeelenCommandArgument.d.ts +4 -3
- package/esm/gen/types/SeelenCommandArgument.d.ts.map +1 -1
- package/esm/gen/types/SeelenCommandReturn.d.ts +4 -2
- package/esm/gen/types/SeelenCommandReturn.d.ts.map +1 -1
- package/esm/gen/types/SeelenEventPayload.d.ts +0 -4
- package/esm/gen/types/SeelenEventPayload.d.ts.map +1 -1
- package/esm/gen/types/mod.d.ts +0 -1
- package/esm/gen/types/mod.d.ts.map +1 -1
- package/esm/gen/types/mod.js +0 -1
- package/esm/src/constants/mod.d.ts +194 -196
- package/esm/src/constants/mod.d.ts.map +1 -1
- package/esm/src/constants/mod.js +52 -61
- package/esm/src/handlers/commands.d.ts +2 -1
- package/esm/src/handlers/commands.d.ts.map +1 -1
- package/esm/src/handlers/commands.js +2 -1
- package/esm/src/handlers/events.d.ts +0 -2
- package/esm/src/handlers/events.d.ts.map +1 -1
- package/esm/src/handlers/events.js +0 -2
- package/esm/src/state/widget/mod.js +1 -1
- package/package.json +7 -6
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts +23 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common16.js +57 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common32.d.ts +35 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common32.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common32.js +198 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_validate_binary_like.d.ts +2 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_validate_binary_like.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/_validate_binary_like.js +29 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/ascii85.d.ts +61 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/ascii85.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/ascii85.js +156 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base32.d.ts +40 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base32.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base32.js +91 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base58.d.ts +40 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base58.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base58.js +135 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts +40 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/base64.js +86 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts +39 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/hex.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/hex.js +91 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/mod.d.ts +98 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/mod.js +115 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/varint.d.ts +120 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/varint.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/encoding/1.0.10/varint.js +211 -0
- package/script/gen/types/AppExtraFlag.d.ts +6 -5
- package/script/gen/types/AppExtraFlag.d.ts.map +1 -1
- package/script/gen/types/AppExtraFlag.js +6 -5
- package/script/gen/types/FancyToolbarSettings.d.ts +0 -8
- package/script/gen/types/FancyToolbarSettings.d.ts.map +1 -1
- package/script/gen/types/FocusedApp.d.ts +6 -0
- package/script/gen/types/FocusedApp.d.ts.map +1 -1
- package/script/gen/types/SeelenCommandArgument.d.ts +4 -3
- package/script/gen/types/SeelenCommandArgument.d.ts.map +1 -1
- package/script/gen/types/SeelenCommandReturn.d.ts +4 -2
- package/script/gen/types/SeelenCommandReturn.d.ts.map +1 -1
- package/script/gen/types/SeelenEventPayload.d.ts +0 -4
- package/script/gen/types/SeelenEventPayload.d.ts.map +1 -1
- package/script/gen/types/mod.d.ts +0 -1
- package/script/gen/types/mod.d.ts.map +1 -1
- package/script/gen/types/mod.js +0 -1
- package/script/src/constants/mod.d.ts +194 -196
- package/script/src/constants/mod.d.ts.map +1 -1
- package/script/src/constants/mod.js +52 -61
- package/script/src/handlers/commands.d.ts +2 -1
- package/script/src/handlers/commands.d.ts.map +1 -1
- package/script/src/handlers/commands.js +2 -1
- package/script/src/handlers/events.d.ts +0 -2
- package/script/src/handlers/events.d.ts.map +1 -1
- package/script/src/handlers/events.js +0 -2
- package/script/src/re-exports/tauri.js +17 -7
- package/script/src/state/widget/mod.js +19 -9
- package/esm/gen/types/SeelenCommandTranslateTextArgs.d.ts +0 -6
- package/esm/gen/types/SeelenCommandTranslateTextArgs.d.ts.map +0 -1
- package/esm/gen/types/SeelenCommandTranslateTextArgs.js +0 -2
- package/script/gen/types/SeelenCommandTranslateTextArgs.d.ts +0 -6
- package/script/gen/types/SeelenCommandTranslateTextArgs.d.ts.map +0 -1
- package/script/gen/types/SeelenCommandTranslateTextArgs.js +0 -3
package/esm/src/constants/mod.js
CHANGED
|
@@ -1,83 +1,74 @@
|
|
|
1
|
-
const
|
|
1
|
+
export const SupportedLanguages = [
|
|
2
|
+
{ label: "Afrikaans", enLabel: "Afrikaans", value: "af" },
|
|
3
|
+
{ label: "አማርኛ", enLabel: "Amharic", value: "am" },
|
|
4
|
+
{ label: "العربية", enLabel: "Arabic", value: "ar" },
|
|
5
|
+
{ label: "Azərbaycan", enLabel: "Azerbaijani", value: "az" },
|
|
6
|
+
{ label: "Български", enLabel: "Bulgarian", value: "bg" },
|
|
7
|
+
{ label: "বাংলা", enLabel: "Bengali", value: "bn" },
|
|
8
|
+
{ label: "Bosanski", enLabel: "Bosnian", value: "bs" },
|
|
9
|
+
{ label: "Català", enLabel: "Catalan", value: "ca" },
|
|
10
|
+
{ label: "Čeština", enLabel: "Czech", value: "cs" },
|
|
11
|
+
{ label: "Cymraeg", enLabel: "Welsh", value: "cy" },
|
|
12
|
+
{ label: "Dansk", enLabel: "Danish", value: "da" },
|
|
2
13
|
{ label: "Deutsch", enLabel: "German", value: "de" },
|
|
14
|
+
{ label: "Ελληνικά", enLabel: "Greek", value: "el" },
|
|
3
15
|
{ label: "English", enLabel: "English", value: "en" },
|
|
4
16
|
{ label: "Español", enLabel: "Spanish", value: "es" },
|
|
5
|
-
{ label: "
|
|
6
|
-
{ label: "
|
|
7
|
-
{ label: "
|
|
17
|
+
{ label: "Eesti", enLabel: "Estonian", value: "et" },
|
|
18
|
+
{ label: "Euskara", enLabel: "Basque", value: "eu" },
|
|
19
|
+
{ label: "فارسی", enLabel: "Persian", value: "fa" },
|
|
20
|
+
{ label: "Suomi", enLabel: "Finnish", value: "fi" },
|
|
8
21
|
{ label: "Français", enLabel: "French", value: "fr" },
|
|
9
|
-
{ label: "
|
|
10
|
-
{
|
|
11
|
-
label: "Português (Portugal)",
|
|
12
|
-
enLabel: "Portuguese (Portugal)",
|
|
13
|
-
value: "pt-PT",
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
label: "Português (Brasil)",
|
|
17
|
-
enLabel: "Portuguese (Brazil)",
|
|
18
|
-
value: "pt-BR",
|
|
19
|
-
},
|
|
20
|
-
{ label: "Русский", enLabel: "Russian", value: "ru" },
|
|
21
|
-
{ label: "हिन्दी", enLabel: "Hindi", value: "hi" },
|
|
22
|
-
{ label: "日本語", enLabel: "Japanese", value: "ja" },
|
|
23
|
-
{ label: "Italiano", enLabel: "Italian", value: "it" },
|
|
24
|
-
{ label: "Nederlands", enLabel: "Dutch", value: "nl" },
|
|
25
|
-
{ label: "Türkçe", enLabel: "Turkish", value: "tr" },
|
|
26
|
-
{ label: "Polski", enLabel: "Polish", value: "pl" },
|
|
27
|
-
{ label: "Українська", enLabel: "Ukrainian", value: "uk" },
|
|
28
|
-
{ label: "Ελληνικά", enLabel: "Greek", value: "el" },
|
|
22
|
+
{ label: "ગુજરાતી", enLabel: "Gujarati", value: "gu" },
|
|
29
23
|
{ label: "עברית", enLabel: "Hebrew", value: "he" },
|
|
30
|
-
{ label: "
|
|
31
|
-
{ label: "Norsk", enLabel: "Norwegian", value: "no" },
|
|
32
|
-
{ label: "Suomi", enLabel: "Finnish", value: "fi" },
|
|
33
|
-
{ label: "Dansk", enLabel: "Danish", value: "da" },
|
|
34
|
-
{ label: "Magyar", enLabel: "Hungarian", value: "hu" },
|
|
35
|
-
{ label: "Română", enLabel: "Romanian", value: "ro" },
|
|
36
|
-
{ label: "Čeština", enLabel: "Czech", value: "cs" },
|
|
37
|
-
{ label: "Slovenský", enLabel: "Slovak", value: "sk" },
|
|
24
|
+
{ label: "हिन्दी", enLabel: "Hindi", value: "hi" },
|
|
38
25
|
{ label: "Hrvatski", enLabel: "Croatian", value: "hr" },
|
|
39
|
-
{ label: "
|
|
40
|
-
{ label: "Lietuvių", enLabel: "Lithuanian", value: "lt" },
|
|
41
|
-
{ label: "Latviešu", enLabel: "Latvian", value: "lv" },
|
|
42
|
-
{ label: "Eesti", enLabel: "Estonian", value: "et" },
|
|
43
|
-
{ label: "Tagalog", enLabel: "Filipino", value: "tl" }, // or fil
|
|
44
|
-
{ label: "Tiếng Việt", enLabel: "Vietnamese", value: "vi" },
|
|
45
|
-
{ label: "ไทย", enLabel: "Thai", value: "th" },
|
|
46
|
-
{ label: "Indonesia", enLabel: "Indonesian", value: "id" },
|
|
47
|
-
{ label: "Malay", enLabel: "Malay", value: "ms" },
|
|
48
|
-
{ label: "Català", enLabel: "Catalan", value: "ca" },
|
|
49
|
-
{ label: "Afrikaans", enLabel: "Afrikaans", value: "af" },
|
|
50
|
-
{ label: "বাংলা", enLabel: "Bengali", value: "bn" },
|
|
51
|
-
{ label: "فارسی", enLabel: "Persian", value: "fa" },
|
|
52
|
-
{ label: "ਪੰਜਾਬੀ", enLabel: "Punjabi", value: "pa" },
|
|
53
|
-
{ label: "Kiswahili", enLabel: "Swahili", value: "sw" },
|
|
54
|
-
{ label: "தமிழ்", enLabel: "Tamil", value: "ta" },
|
|
55
|
-
{ label: "اردو", enLabel: "Urdu", value: "ur" },
|
|
56
|
-
{ label: "Cymraeg", enLabel: "Welsh", value: "cy" },
|
|
57
|
-
{ label: "አማርኛ", enLabel: "Amharic", value: "am" },
|
|
26
|
+
{ label: "Magyar", enLabel: "Hungarian", value: "hu" },
|
|
58
27
|
{ label: "Հայերեն", enLabel: "Armenian", value: "hy" },
|
|
59
|
-
{ label: "
|
|
60
|
-
{ label: "Euskara", enLabel: "Basque", value: "eu" },
|
|
61
|
-
{ label: "Bosanski", enLabel: "Bosnian", value: "bs" },
|
|
62
|
-
{ label: "ქართული", enLabel: "Georgian", value: "ka" },
|
|
63
|
-
{ label: "ગુજરાતી", enLabel: "Gujarati", value: "gu" },
|
|
28
|
+
{ label: "Indonesia", enLabel: "Indonesian", value: "id" },
|
|
64
29
|
{ label: "Íslenska", enLabel: "Icelandic", value: "is" },
|
|
30
|
+
{ label: "Italiano", enLabel: "Italian", value: "it" },
|
|
31
|
+
{ label: "日本語", enLabel: "Japanese", value: "ja" },
|
|
32
|
+
{ label: "ქართული", enLabel: "Georgian", value: "ka" },
|
|
65
33
|
{ label: "ភាសាខ្មែរ", enLabel: "Khmer", value: "km" },
|
|
34
|
+
{ label: "한국어", enLabel: "Korean", value: "ko" },
|
|
66
35
|
{ label: "Kurdî", enLabel: "Kurdish", value: "ku" },
|
|
67
|
-
{ label: "ລາວ", enLabel: "Lao", value: "lo" },
|
|
68
36
|
{ label: "Lëtzebuergesch", enLabel: "Luxembourgish", value: "lb" },
|
|
37
|
+
{ label: "ລາວ", enLabel: "Lao", value: "lo" },
|
|
38
|
+
{ label: "Lietuvių", enLabel: "Lithuanian", value: "lt" },
|
|
39
|
+
{ label: "Latviešu", enLabel: "Latvian", value: "lv" },
|
|
69
40
|
{ label: "Македонски", enLabel: "Macedonian", value: "mk" },
|
|
70
|
-
{ label: "Malti", enLabel: "Maltese", value: "mt" },
|
|
71
41
|
{ label: "Монгол", enLabel: "Mongolian", value: "mn" },
|
|
42
|
+
{ label: "Malay", enLabel: "Malay", value: "ms" },
|
|
43
|
+
{ label: "Malti", enLabel: "Maltese", value: "mt" },
|
|
72
44
|
{ label: "नेपाली", enLabel: "Nepali", value: "ne" },
|
|
45
|
+
{ label: "Nederlands", enLabel: "Dutch", value: "nl" },
|
|
46
|
+
{ label: "Norsk", enLabel: "Norwegian", value: "no" },
|
|
47
|
+
{ label: "ਪੰਜਾਬੀ", enLabel: "Punjabi", value: "pa" },
|
|
48
|
+
{ label: "Polski", enLabel: "Polish", value: "pl" },
|
|
73
49
|
{ label: "پښتو", enLabel: "Pashto", value: "ps" },
|
|
74
|
-
{ label: "
|
|
50
|
+
{ label: "Português (Brasil)", enLabel: "Portuguese (Brazil)", value: "pt-BR" },
|
|
51
|
+
{ label: "Português (Portugal)", enLabel: "Portuguese (Portugal)", value: "pt-PT" },
|
|
52
|
+
{ label: "Română", enLabel: "Romanian", value: "ro" },
|
|
53
|
+
{ label: "Русский", enLabel: "Russian", value: "ru" },
|
|
75
54
|
{ label: "සිංහල", enLabel: "Sinhala", value: "si" },
|
|
55
|
+
{ label: "Slovenský", enLabel: "Slovak", value: "sk" },
|
|
76
56
|
{ label: "Soomaali", enLabel: "Somali", value: "so" },
|
|
77
|
-
{ label: "
|
|
57
|
+
{ label: "Српски", enLabel: "Serbian", value: "sr" },
|
|
58
|
+
{ label: "Svenska", enLabel: "Swedish", value: "sv" },
|
|
59
|
+
{ label: "Kiswahili", enLabel: "Swahili", value: "sw" },
|
|
60
|
+
{ label: "தமிழ்", enLabel: "Tamil", value: "ta" },
|
|
78
61
|
{ label: "తెలుగు", enLabel: "Telugu", value: "te" },
|
|
62
|
+
{ label: "Тоҷикӣ", enLabel: "Tajik", value: "tg" },
|
|
63
|
+
{ label: "ไทย", enLabel: "Thai", value: "th" },
|
|
64
|
+
{ label: "Tagalog", enLabel: "Filipino", value: "tl" },
|
|
65
|
+
{ label: "Türkçe", enLabel: "Turkish", value: "tr" },
|
|
66
|
+
{ label: "Українська", enLabel: "Ukrainian", value: "uk" },
|
|
67
|
+
{ label: "اردو", enLabel: "Urdu", value: "ur" },
|
|
79
68
|
{ label: "Oʻzbek", enLabel: "Uzbek", value: "uz" },
|
|
69
|
+
{ label: "Tiếng Việt", enLabel: "Vietnamese", value: "vi" },
|
|
80
70
|
{ label: "Yorùbá", enLabel: "Yoruba", value: "yo" },
|
|
71
|
+
{ label: "中文 (简体)", enLabel: "Chinese (Simplified)", value: "zh-CN" },
|
|
72
|
+
{ label: "中文 (繁體)", enLabel: "Chinese (Traditional)", value: "zh-TW" },
|
|
81
73
|
{ label: "isiZulu", enLabel: "Zulu", value: "zu" },
|
|
82
74
|
];
|
|
83
|
-
export const SupportedLanguages = _languageList.toSorted((a, b) => a.label.localeCompare(b.label));
|
|
@@ -4,6 +4,7 @@ export declare enum SeelenCommand {
|
|
|
4
4
|
Run = "run",
|
|
5
5
|
RunAsAdmin = "run_as_admin",
|
|
6
6
|
GetFocusedApp = "get_focused_app",
|
|
7
|
+
GetMousePosition = "get_mouse_position",
|
|
7
8
|
IsDevMode = "is_dev_mode",
|
|
8
9
|
IsAppxPackage = "is_appx_package",
|
|
9
10
|
OpenFile = "open_file",
|
|
@@ -17,7 +18,6 @@ export declare enum SeelenCommand {
|
|
|
17
18
|
RequestToUserInputShortcut = "request_to_user_input_shortcut",
|
|
18
19
|
CheckForUpdates = "check_for_updates",
|
|
19
20
|
InstallLastAvailableUpdate = "install_last_available_update",
|
|
20
|
-
TranslateText = "translate_text",
|
|
21
21
|
SystemGetForegroundWindowColor = "get_foreground_window_color",
|
|
22
22
|
SystemGetMonitors = "get_connected_monitors",
|
|
23
23
|
SystemGetColors = "get_system_colors",
|
|
@@ -47,6 +47,7 @@ export declare enum SeelenCommand {
|
|
|
47
47
|
StateRequestWallpaperAddition = "state_request_wallpaper_addition",
|
|
48
48
|
StateGetPerformanceMode = "state_get_performance_mode",
|
|
49
49
|
TriggerWidget = "trigger_widget",
|
|
50
|
+
GetSelfWindowId = "get_self_window_handle",
|
|
50
51
|
GetNativeShellWallpaper = "get_native_shell_wallpaper",
|
|
51
52
|
SetNativeShellWallpaper = "set_native_shell_wallpaper",
|
|
52
53
|
GetUser = "get_user",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/src/handlers/commands.ts"],"names":[],"mappings":"AACA,oBAAY,aAAa;IACvB,uBAAuB,yBAAyB;IAChD,eAAe,qBAAqB;IACpC,GAAG,QAAQ;IACX,UAAU,iBAAiB;IAC3B,aAAa,oBAAoB;IACjC,SAAS,gBAAgB;IACzB,aAAa,oBAAoB;IACjC,QAAQ,cAAc;IACtB,oBAAoB,4BAA4B;IAChD,WAAW,kBAAkB;IAC7B,eAAe,sBAAsB;IACrC,QAAQ,cAAc;IACtB,OAAO,aAAa;IACpB,kBAAkB,wBAAwB;IAC1C,WAAW,iBAAiB;IAC5B,0BAA0B,mCAAmC;IAC7D,eAAe,sBAAsB;IACrC,0BAA0B,kCAAkC;IAC5D,
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/src/handlers/commands.ts"],"names":[],"mappings":"AACA,oBAAY,aAAa;IACvB,uBAAuB,yBAAyB;IAChD,eAAe,qBAAqB;IACpC,GAAG,QAAQ;IACX,UAAU,iBAAiB;IAC3B,aAAa,oBAAoB;IACjC,gBAAgB,uBAAuB;IACvC,SAAS,gBAAgB;IACzB,aAAa,oBAAoB;IACjC,QAAQ,cAAc;IACtB,oBAAoB,4BAA4B;IAChD,WAAW,kBAAkB;IAC7B,eAAe,sBAAsB;IACrC,QAAQ,cAAc;IACtB,OAAO,aAAa;IACpB,kBAAkB,wBAAwB;IAC1C,WAAW,iBAAiB;IAC5B,0BAA0B,mCAAmC;IAC7D,eAAe,sBAAsB;IACrC,0BAA0B,kCAAkC;IAC5D,8BAA8B,gCAAgC;IAC9D,iBAAiB,2BAA2B;IAC5C,eAAe,sBAAsB;IACrC,kBAAkB,yBAAyB;IAC3C,uBAAuB,+BAA+B;IACtD,uBAAuB,+BAA+B;IACtD,8BAA8B,uCAAuC;IACrE,gCAAgC,yCAAyC;IACzE,YAAY,mBAAmB;IAC/B,kBAAkB,0BAA0B;IAC5C,cAAc,oBAAoB;IAClC,cAAc,qBAAqB;IACnC,gBAAgB,wBAAwB;IACxC,kBAAkB,0BAA0B;IAC5C,oBAAoB,4BAA4B;IAChD,gBAAgB,uBAAuB;IACvC,kBAAkB,yBAAyB;IAC3C,kCAAkC,2CAA2C;IAC7E,eAAe,sBAAsB;IACrC,eAAe,sBAAsB;IACrC,eAAe,sBAAsB;IACrC,iBAAiB,yBAAyB;IAC1C,kBAAkB,yBAAyB;IAC3C,sBAAsB,uCAAuC;IAC7D,gBAAgB,uBAAuB;IACvC,sBAAsB,8BAA8B;IACpD,6BAA6B,qCAAqC;IAClE,uBAAuB,+BAA+B;IACtD,aAAa,mBAAmB;IAChC,eAAe,2BAA2B;IAC1C,uBAAuB,+BAA+B;IACtD,uBAAuB,+BAA+B;IACtD,OAAO,aAAa;IACpB,oBAAoB,4BAA4B;IAChD,kBAAkB,0BAA0B;IAC5C,mBAAmB,0BAA0B;IAC7C,iBAAiB,yBAAyB;IAC1C,4BAA4B,oCAAoC;IAChE,sBAAsB,6BAA6B;IACnD,qBAAqB,4BAA4B;IACjD,mBAAmB,0BAA0B;IAC7C,qBAAqB,4BAA4B;IACjD,0BAA0B,kCAAkC;IAC5D,eAAe,sBAAsB;IACrC,gBAAgB,uBAAuB;IACvC,SAAS,eAAe;IACxB,oBAAoB,4BAA4B;IAChD,SAAS,eAAe;IACxB,cAAc,qBAAqB;IACnC,eAAe,sBAAsB;IACrC,qBAAqB,6BAA6B;IAClD,wBAAwB,gCAAgC;IACxD,wBAAwB,gCAAgC;IACxD,cAAc,qBAAqB;IACnC,YAAY,mBAAmB;IAC/B,YAAY,kBAAkB;IAC9B,MAAM,YAAY;IAClB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,WAAW,kBAAkB;IAC7B,UAAU,iBAAiB;IAC3B,oBAAoB,4BAA4B;IAChD,wBAAwB,gCAAgC;IACxD,UAAU,iBAAiB;IAC3B,sBAAsB,8BAA8B;IACpD,YAAY,kBAAkB;IAC9B,eAAe,sBAAsB;IACrC,WAAW,iBAAiB;IAC5B,WAAW,iBAAiB;IAC5B,UAAU,gBAAgB;IAC1B,cAAc,qBAAqB;IACnC,eAAe,sBAAsB;IACrC,iBAAiB,wBAAwB;IACzC,gBAAgB,uBAAuB;IACvC,WAAW,iBAAiB;IAC5B,cAAc,oBAAoB;IAClC,kBAAkB,0BAA0B;IAC5C,wBAAwB,iCAAiC;IACzD,gBAAgB,sBAAsB;IACtC,kBAAkB,wBAAwB;IAC1C,qBAAqB,4BAA4B;IACjD,oBAAoB,0BAA0B;CAC/C"}
|
|
@@ -6,6 +6,7 @@ export var SeelenCommand;
|
|
|
6
6
|
SeelenCommand["Run"] = "run";
|
|
7
7
|
SeelenCommand["RunAsAdmin"] = "run_as_admin";
|
|
8
8
|
SeelenCommand["GetFocusedApp"] = "get_focused_app";
|
|
9
|
+
SeelenCommand["GetMousePosition"] = "get_mouse_position";
|
|
9
10
|
SeelenCommand["IsDevMode"] = "is_dev_mode";
|
|
10
11
|
SeelenCommand["IsAppxPackage"] = "is_appx_package";
|
|
11
12
|
SeelenCommand["OpenFile"] = "open_file";
|
|
@@ -19,7 +20,6 @@ export var SeelenCommand;
|
|
|
19
20
|
SeelenCommand["RequestToUserInputShortcut"] = "request_to_user_input_shortcut";
|
|
20
21
|
SeelenCommand["CheckForUpdates"] = "check_for_updates";
|
|
21
22
|
SeelenCommand["InstallLastAvailableUpdate"] = "install_last_available_update";
|
|
22
|
-
SeelenCommand["TranslateText"] = "translate_text";
|
|
23
23
|
SeelenCommand["SystemGetForegroundWindowColor"] = "get_foreground_window_color";
|
|
24
24
|
SeelenCommand["SystemGetMonitors"] = "get_connected_monitors";
|
|
25
25
|
SeelenCommand["SystemGetColors"] = "get_system_colors";
|
|
@@ -49,6 +49,7 @@ export var SeelenCommand;
|
|
|
49
49
|
SeelenCommand["StateRequestWallpaperAddition"] = "state_request_wallpaper_addition";
|
|
50
50
|
SeelenCommand["StateGetPerformanceMode"] = "state_get_performance_mode";
|
|
51
51
|
SeelenCommand["TriggerWidget"] = "trigger_widget";
|
|
52
|
+
SeelenCommand["GetSelfWindowId"] = "get_self_window_handle";
|
|
52
53
|
SeelenCommand["GetNativeShellWallpaper"] = "get_native_shell_wallpaper";
|
|
53
54
|
SeelenCommand["SetNativeShellWallpaper"] = "set_native_shell_wallpaper";
|
|
54
55
|
SeelenCommand["GetUser"] = "get_user";
|
|
@@ -25,8 +25,6 @@ export declare enum SeelenEvent {
|
|
|
25
25
|
PowerMode = "power-mode",
|
|
26
26
|
BatteriesStatus = "batteries-status",
|
|
27
27
|
ColorsChanged = "colors-changed",
|
|
28
|
-
ToolbarOverlaped = "set-auto-hide",
|
|
29
|
-
WegOverlaped = "set-auto-hide",
|
|
30
28
|
WMSetReservation = "set-reservation",
|
|
31
29
|
WMForceRetiling = "wm-force-retiling",
|
|
32
30
|
WMSetLayout = "wm-set-layout",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/src/handlers/events.ts"],"names":[],"mappings":"AACA,oBAAY,WAAW;IACrB,sBAAsB,8BAA8B;IACpD,kBAAkB,yBAAyB;IAC3C,eAAe,sBAAsB;IACrC,qBAAqB,mBAAmB;IACxC,qBAAqB,6BAA6B;IAClD,sBAAsB,8BAA8B;IACpD,WAAW,iBAAiB;IAC5B,iBAAiB,wBAAwB;IACzC,uBAAuB,+BAA+B;IACtD,qBAAqB,0BAA0B;IAC/C,uBAAuB,8BAA8B;IACrD,iCAAiC,yCAAyC;IAC1E,oBAAoB,4BAA4B;IAChD,uBAAuB,+BAA+B;IACtD,aAAa,mBAAmB;IAChC,WAAW,iBAAiB;IAC5B,YAAY,kBAAkB;IAC9B,qBAAqB,6BAA6B;IAClD,eAAe,qBAAqB;IACpC,yBAAyB,gCAAgC;IACzD,kBAAkB,iBAAiB;IACnC,aAAa,kBAAkB;IAC/B,WAAW,iBAAiB;IAC5B,SAAS,eAAe;IACxB,eAAe,qBAAqB;IACpC,aAAa,mBAAmB;IAChC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/src/handlers/events.ts"],"names":[],"mappings":"AACA,oBAAY,WAAW;IACrB,sBAAsB,8BAA8B;IACpD,kBAAkB,yBAAyB;IAC3C,eAAe,sBAAsB;IACrC,qBAAqB,mBAAmB;IACxC,qBAAqB,6BAA6B;IAClD,sBAAsB,8BAA8B;IACpD,WAAW,iBAAiB;IAC5B,iBAAiB,wBAAwB;IACzC,uBAAuB,+BAA+B;IACtD,qBAAqB,0BAA0B;IAC/C,uBAAuB,8BAA8B;IACrD,iCAAiC,yCAAyC;IAC1E,oBAAoB,4BAA4B;IAChD,uBAAuB,+BAA+B;IACtD,aAAa,mBAAmB;IAChC,WAAW,iBAAiB;IAC5B,YAAY,kBAAkB;IAC9B,qBAAqB,6BAA6B;IAClD,eAAe,qBAAqB;IACpC,yBAAyB,gCAAgC;IACzD,kBAAkB,iBAAiB;IACnC,aAAa,kBAAkB;IAC/B,WAAW,iBAAiB;IAC5B,SAAS,eAAe;IACxB,eAAe,qBAAqB;IACpC,aAAa,mBAAmB;IAChC,gBAAgB,oBAAoB;IACpC,eAAe,sBAAsB;IACrC,WAAW,kBAAkB;IAC7B,mBAAmB,0BAA0B;IAC7C,oBAAoB,qBAAqB;IACzC,oBAAoB,cAAc;IAClC,wBAAwB,kBAAkB;IAC1C,kBAAkB,WAAW;IAC7B,yBAAyB,oBAAoB;IAC7C,mBAAmB,YAAY;IAC/B,qBAAqB,eAAe;IACpC,mBAAmB,oBAAoB;IACvC,mBAAmB,oBAAoB;IACvC,sBAAsB,sCAAsC;IAC5D,oBAAoB,qBAAqB;IACzC,iBAAiB,yBAAyB;IAC1C,2BAA2B,oCAAoC;IAC/D,eAAe,sBAAsB;CACtC"}
|
|
@@ -27,8 +27,6 @@ export var SeelenEvent;
|
|
|
27
27
|
SeelenEvent["PowerMode"] = "power-mode";
|
|
28
28
|
SeelenEvent["BatteriesStatus"] = "batteries-status";
|
|
29
29
|
SeelenEvent["ColorsChanged"] = "colors-changed";
|
|
30
|
-
SeelenEvent["ToolbarOverlaped"] = "set-auto-hide";
|
|
31
|
-
SeelenEvent["WegOverlaped"] = "set-auto-hide";
|
|
32
30
|
SeelenEvent["WMSetReservation"] = "set-reservation";
|
|
33
31
|
SeelenEvent["WMForceRetiling"] = "wm-force-retiling";
|
|
34
32
|
SeelenEvent["WMSetLayout"] = "wm-set-layout";
|
|
@@ -4,7 +4,7 @@ import { SeelenCommand, SeelenEvent, subscribe } from "../../handlers/mod.js";
|
|
|
4
4
|
import { List } from "../../utils/List.js";
|
|
5
5
|
import { newFromInvoke, newOnEvent } from "../../utils/State.js";
|
|
6
6
|
import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow";
|
|
7
|
-
import { decodeBase64Url } from "../../../deps/jsr.io/@std/encoding/1.0.10/
|
|
7
|
+
import { decodeBase64Url } from "../../../deps/jsr.io/@std/encoding/1.0.10/mod.js";
|
|
8
8
|
import { PhysicalPosition, PhysicalSize } from "@tauri-apps/api/dpi";
|
|
9
9
|
import { monitorFromPoint } from "@tauri-apps/api/window";
|
|
10
10
|
import { debounce } from "../../utils/async.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seelen-ui/lib",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.8",
|
|
4
4
|
"description": "Seelen UI Library for Widgets",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,12 +26,13 @@
|
|
|
26
26
|
"require": "./script/src/re-exports/tauri.js"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
+
"scripts": {},
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"@tauri-apps/api": "^2.
|
|
31
|
-
"@tauri-apps/plugin-dialog": "^2.
|
|
32
|
-
"@tauri-apps/plugin-fs": "^2.4.
|
|
33
|
-
"@tauri-apps/plugin-log": "^2.
|
|
34
|
-
"@tauri-apps/plugin-process": "^2.3.
|
|
31
|
+
"@tauri-apps/api": "^2.9.0",
|
|
32
|
+
"@tauri-apps/plugin-dialog": "^2.4.2",
|
|
33
|
+
"@tauri-apps/plugin-fs": "^2.4.4",
|
|
34
|
+
"@tauri-apps/plugin-log": "^2.7.1",
|
|
35
|
+
"@tauri-apps/plugin-process": "^2.3.1"
|
|
35
36
|
},
|
|
36
37
|
"_generatedBy": "dnt@dev"
|
|
37
38
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Uint8Array_ } from "./_types.js";
|
|
2
|
+
export type { Uint8Array_ };
|
|
3
|
+
export declare const alphabet: Uint8Array<ArrayBufferLike>;
|
|
4
|
+
export declare const rAlphabet: Uint8Array<ArrayBuffer>;
|
|
5
|
+
/**
|
|
6
|
+
* Calculate the output size needed to encode a given input size for
|
|
7
|
+
* {@linkcode encodeIntoHex}.
|
|
8
|
+
*
|
|
9
|
+
* @param originalSize The size of the input buffer.
|
|
10
|
+
* @returns The size of the output buffer.
|
|
11
|
+
*
|
|
12
|
+
* @example Basic Usage
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { assertEquals } from "@std/assert";
|
|
15
|
+
* import { calcSizeHex } from "@std/encoding/unstable-hex";
|
|
16
|
+
*
|
|
17
|
+
* assertEquals(calcSizeHex(1), 2);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function calcSizeHex(originalSize: number): number;
|
|
21
|
+
export declare function encode(buffer: Uint8Array_, i: number, o: number, alphabet: Uint8Array): number;
|
|
22
|
+
export declare function decode(buffer: Uint8Array_, i: number, o: number, alphabet: Uint8Array): number;
|
|
23
|
+
//# sourceMappingURL=_common16.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_common16.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.10/_common16.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,eAAO,MAAM,QAAQ,6BAA+C,CAAC;AACrE,eAAO,MAAM,SAAS,yBAA+B,CAAC;AAMtD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,MAAM,CACpB,MAAM,EAAE,WAAW,EACnB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,EAAE,UAAU,GACnB,MAAM,CAOR;AAED,wBAAgB,MAAM,CACpB,MAAM,EAAE,WAAW,EACnB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,EAAE,UAAU,GACnB,MAAM,CAeR"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.rAlphabet = exports.alphabet = void 0;
|
|
5
|
+
exports.calcSizeHex = calcSizeHex;
|
|
6
|
+
exports.encode = encode;
|
|
7
|
+
exports.decode = decode;
|
|
8
|
+
exports.alphabet = new TextEncoder().encode("0123456789abcdef");
|
|
9
|
+
exports.rAlphabet = new Uint8Array(128).fill(16); // alphabet.Hex.length
|
|
10
|
+
exports.alphabet.forEach((byte, i) => exports.rAlphabet[byte] = i);
|
|
11
|
+
new TextEncoder()
|
|
12
|
+
.encode("ABCDEF")
|
|
13
|
+
.forEach((byte, i) => exports.rAlphabet[byte] = i + 10);
|
|
14
|
+
/**
|
|
15
|
+
* Calculate the output size needed to encode a given input size for
|
|
16
|
+
* {@linkcode encodeIntoHex}.
|
|
17
|
+
*
|
|
18
|
+
* @param originalSize The size of the input buffer.
|
|
19
|
+
* @returns The size of the output buffer.
|
|
20
|
+
*
|
|
21
|
+
* @example Basic Usage
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { assertEquals } from "@std/assert";
|
|
24
|
+
* import { calcSizeHex } from "@std/encoding/unstable-hex";
|
|
25
|
+
*
|
|
26
|
+
* assertEquals(calcSizeHex(1), 2);
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
function calcSizeHex(originalSize) {
|
|
30
|
+
return originalSize * 2;
|
|
31
|
+
}
|
|
32
|
+
function encode(buffer, i, o, alphabet) {
|
|
33
|
+
for (; i < buffer.length; ++i) {
|
|
34
|
+
const x = buffer[i];
|
|
35
|
+
buffer[o++] = alphabet[x >> 4];
|
|
36
|
+
buffer[o++] = alphabet[x & 0xF];
|
|
37
|
+
}
|
|
38
|
+
return o;
|
|
39
|
+
}
|
|
40
|
+
function decode(buffer, i, o, alphabet) {
|
|
41
|
+
if ((buffer.length - o) % 2 === 1) {
|
|
42
|
+
throw new RangeError(`Cannot decode input as hex: Length (${buffer.length - o}) must be divisible by 2`);
|
|
43
|
+
}
|
|
44
|
+
i += 1;
|
|
45
|
+
for (; i < buffer.length; i += 2) {
|
|
46
|
+
buffer[o++] = (getByte(buffer[i - 1], alphabet) << 4) |
|
|
47
|
+
getByte(buffer[i], alphabet);
|
|
48
|
+
}
|
|
49
|
+
return o;
|
|
50
|
+
}
|
|
51
|
+
function getByte(char, alphabet) {
|
|
52
|
+
const byte = alphabet[char] ?? 16;
|
|
53
|
+
if (byte === 16) { // alphabet.Hex.length
|
|
54
|
+
throw new TypeError(`Cannot decode input as hex: Invalid character (${String.fromCharCode(char)})`);
|
|
55
|
+
}
|
|
56
|
+
return byte;
|
|
57
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Uint8Array_ } from "./_types.js";
|
|
2
|
+
export type { Uint8Array_ };
|
|
3
|
+
export declare const padding: number;
|
|
4
|
+
export declare const alphabet: Record<Base32Alphabet, Uint8Array>;
|
|
5
|
+
export declare const rAlphabet: Record<Base32Alphabet, Uint8Array>;
|
|
6
|
+
/**
|
|
7
|
+
* Options for encoding and decoding base32 strings.
|
|
8
|
+
*/
|
|
9
|
+
export interface Base32Options {
|
|
10
|
+
/** The base32 alphabet. Defaults to "base32" */
|
|
11
|
+
alphabet?: Base32Alphabet;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The base32 alphabets.
|
|
15
|
+
*/
|
|
16
|
+
export type Base32Alphabet = "base32" | "base32hex" | "base32crockford";
|
|
17
|
+
/**
|
|
18
|
+
* Calculate the output size needed to encode a given input size for
|
|
19
|
+
* {@linkcode encodeIntoBase32}.
|
|
20
|
+
*
|
|
21
|
+
* @param rawSize The size of the input buffer.
|
|
22
|
+
* @returns The size of the output buffer.
|
|
23
|
+
*
|
|
24
|
+
* @example Basic Usage
|
|
25
|
+
* ```ts
|
|
26
|
+
* import { assertEquals } from "@std/assert";
|
|
27
|
+
* import { calcSizeBase32 } from "@std/encoding/unstable-base32";
|
|
28
|
+
*
|
|
29
|
+
* assertEquals(calcSizeBase32(1), 8);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function calcSizeBase32(rawSize: number): number;
|
|
33
|
+
export declare function encode(buffer: Uint8Array_, i: number, o: number, alphabet: Uint8Array, padding: number): number;
|
|
34
|
+
export declare function decode(buffer: Uint8Array_, i: number, o: number, alphabet: Uint8Array, padding: number): number;
|
|
35
|
+
//# sourceMappingURL=_common32.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_common32.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.10/_common32.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,eAAO,MAAM,OAAO,QAAoB,CAAC;AACzC,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,cAAc,EAAE,UAAU,CAIvD,CAAC;AACF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,cAAc,EAAE,UAAU,CAIxD,CAAC;AAQF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,WAAW,GAAG,iBAAiB,CAAC;AAExE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,MAAM,CACpB,MAAM,EAAE,WAAW,EACnB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,MAAM,GACd,MAAM,CAmER;AAED,wBAAgB,MAAM,CACpB,MAAM,EAAE,WAAW,EACnB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,MAAM,GACd,MAAM,CAyFR"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.rAlphabet = exports.alphabet = exports.padding = void 0;
|
|
5
|
+
exports.calcSizeBase32 = calcSizeBase32;
|
|
6
|
+
exports.encode = encode;
|
|
7
|
+
exports.decode = decode;
|
|
8
|
+
exports.padding = "=".charCodeAt(0);
|
|
9
|
+
exports.alphabet = {
|
|
10
|
+
base32: new TextEncoder().encode("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),
|
|
11
|
+
base32hex: new TextEncoder().encode("0123456789ABCDEFGHIJKLMNOPQRSTUV"),
|
|
12
|
+
base32crockford: new TextEncoder().encode("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),
|
|
13
|
+
};
|
|
14
|
+
exports.rAlphabet = {
|
|
15
|
+
base32: new Uint8Array(128).fill(32), // alphabet.base32.length
|
|
16
|
+
base32hex: new Uint8Array(128).fill(32),
|
|
17
|
+
base32crockford: new Uint8Array(128).fill(32),
|
|
18
|
+
};
|
|
19
|
+
exports.alphabet.base32
|
|
20
|
+
.forEach((byte, i) => exports.rAlphabet.base32[byte] = i);
|
|
21
|
+
exports.alphabet.base32hex
|
|
22
|
+
.forEach((byte, i) => exports.rAlphabet.base32hex[byte] = i);
|
|
23
|
+
exports.alphabet.base32crockford
|
|
24
|
+
.forEach((byte, i) => exports.rAlphabet.base32crockford[byte] = i);
|
|
25
|
+
/**
|
|
26
|
+
* Calculate the output size needed to encode a given input size for
|
|
27
|
+
* {@linkcode encodeIntoBase32}.
|
|
28
|
+
*
|
|
29
|
+
* @param rawSize The size of the input buffer.
|
|
30
|
+
* @returns The size of the output buffer.
|
|
31
|
+
*
|
|
32
|
+
* @example Basic Usage
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { assertEquals } from "@std/assert";
|
|
35
|
+
* import { calcSizeBase32 } from "@std/encoding/unstable-base32";
|
|
36
|
+
*
|
|
37
|
+
* assertEquals(calcSizeBase32(1), 8);
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
function calcSizeBase32(rawSize) {
|
|
41
|
+
return ((rawSize + 4) / 5 | 0) * 8;
|
|
42
|
+
}
|
|
43
|
+
function encode(buffer, i, o, alphabet, padding) {
|
|
44
|
+
i += 4;
|
|
45
|
+
for (; i < buffer.length; i += 5) {
|
|
46
|
+
let x = (buffer[i - 4] << 16) | (buffer[i - 3] << 8) | buffer[i - 2];
|
|
47
|
+
buffer[o++] = alphabet[x >> 19];
|
|
48
|
+
buffer[o++] = alphabet[x >> 14 & 0x1F];
|
|
49
|
+
buffer[o++] = alphabet[x >> 9 & 0x1F];
|
|
50
|
+
buffer[o++] = alphabet[x >> 4 & 0x1F];
|
|
51
|
+
x = (x << 16) | (buffer[i - 1] << 8) | buffer[i];
|
|
52
|
+
buffer[o++] = alphabet[x >> 15 & 0x1F];
|
|
53
|
+
buffer[o++] = alphabet[x >> 10 & 0x1F];
|
|
54
|
+
buffer[o++] = alphabet[x >> 5 & 0x1F];
|
|
55
|
+
buffer[o++] = alphabet[x & 0x1F];
|
|
56
|
+
}
|
|
57
|
+
switch (i) {
|
|
58
|
+
case buffer.length + 3: {
|
|
59
|
+
const x = buffer[i - 4] << 16;
|
|
60
|
+
buffer[o++] = alphabet[x >> 19];
|
|
61
|
+
buffer[o++] = alphabet[x >> 14 & 0x1F];
|
|
62
|
+
buffer[o++] = padding;
|
|
63
|
+
buffer[o++] = padding;
|
|
64
|
+
buffer[o++] = padding;
|
|
65
|
+
buffer[o++] = padding;
|
|
66
|
+
buffer[o++] = padding;
|
|
67
|
+
buffer[o++] = padding;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case buffer.length + 2: {
|
|
71
|
+
const x = (buffer[i - 4] << 16) | (buffer[i - 3] << 8);
|
|
72
|
+
buffer[o++] = alphabet[x >> 19];
|
|
73
|
+
buffer[o++] = alphabet[x >> 14 & 0x1F];
|
|
74
|
+
buffer[o++] = alphabet[x >> 9 & 0x1F];
|
|
75
|
+
buffer[o++] = alphabet[x >> 4 & 0x1F];
|
|
76
|
+
buffer[o++] = padding;
|
|
77
|
+
buffer[o++] = padding;
|
|
78
|
+
buffer[o++] = padding;
|
|
79
|
+
buffer[o++] = padding;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case buffer.length + 1: {
|
|
83
|
+
let x = (buffer[i - 4] << 16) | (buffer[i - 3] << 8) | buffer[i - 2];
|
|
84
|
+
buffer[o++] = alphabet[x >> 19];
|
|
85
|
+
buffer[o++] = alphabet[x >> 14 & 0x1F];
|
|
86
|
+
buffer[o++] = alphabet[x >> 9 & 0x1F];
|
|
87
|
+
buffer[o++] = alphabet[x >> 4 & 0x1F];
|
|
88
|
+
x <<= 16;
|
|
89
|
+
buffer[o++] = alphabet[x >> 15 & 0x1F];
|
|
90
|
+
buffer[o++] = padding;
|
|
91
|
+
buffer[o++] = padding;
|
|
92
|
+
buffer[o++] = padding;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
case buffer.length: {
|
|
96
|
+
let x = (buffer[i - 4] << 16) | (buffer[i - 3] << 8) | buffer[i - 2];
|
|
97
|
+
buffer[o++] = alphabet[x >> 19];
|
|
98
|
+
buffer[o++] = alphabet[x >> 14 & 0x1F];
|
|
99
|
+
buffer[o++] = alphabet[x >> 9 & 0x1F];
|
|
100
|
+
buffer[o++] = alphabet[x >> 4 & 0x1F];
|
|
101
|
+
x = (x << 16) | (buffer[i - 1] << 8);
|
|
102
|
+
buffer[o++] = alphabet[x >> 15 & 0x1F];
|
|
103
|
+
buffer[o++] = alphabet[x >> 10 & 0x1F];
|
|
104
|
+
buffer[o++] = alphabet[x >> 5 & 0x1F];
|
|
105
|
+
buffer[o++] = padding;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return o;
|
|
110
|
+
}
|
|
111
|
+
function decode(buffer, i, o, alphabet, padding) {
|
|
112
|
+
for (let x = buffer.length - 6; x < buffer.length; ++x) {
|
|
113
|
+
if (buffer[x] === padding) {
|
|
114
|
+
for (let y = x + 1; y < buffer.length; ++y) {
|
|
115
|
+
if (buffer[y] !== padding) {
|
|
116
|
+
throw new TypeError(`Cannot decode input as base32: Invalid character (${String.fromCharCode(buffer[y])})`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
buffer = buffer.subarray(0, x);
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
switch ((buffer.length - o) % 8) {
|
|
124
|
+
case 6:
|
|
125
|
+
case 3:
|
|
126
|
+
case 1:
|
|
127
|
+
throw new RangeError(`Cannot decode input as base32: Length (${buffer.length - o}), excluding padding, must not have a remainder of 1, 3, or 6 when divided by 8`);
|
|
128
|
+
}
|
|
129
|
+
i += 7;
|
|
130
|
+
for (; i < buffer.length; i += 8) {
|
|
131
|
+
let x = (getByte(buffer[i - 7], alphabet) << 19) |
|
|
132
|
+
(getByte(buffer[i - 6], alphabet) << 14) |
|
|
133
|
+
(getByte(buffer[i - 5], alphabet) << 9) |
|
|
134
|
+
(getByte(buffer[i - 4], alphabet) << 4);
|
|
135
|
+
buffer[o++] = x >> 16;
|
|
136
|
+
buffer[o++] = x >> 8 & 0xFF;
|
|
137
|
+
x = (x << 16) |
|
|
138
|
+
(getByte(buffer[i - 3], alphabet) << 15) |
|
|
139
|
+
(getByte(buffer[i - 2], alphabet) << 10) |
|
|
140
|
+
(getByte(buffer[i - 1], alphabet) << 5) |
|
|
141
|
+
getByte(buffer[i], alphabet);
|
|
142
|
+
buffer[o++] = x >> 16 & 0xFF;
|
|
143
|
+
buffer[o++] = x >> 8 & 0xFF;
|
|
144
|
+
buffer[o++] = x & 0xFF;
|
|
145
|
+
}
|
|
146
|
+
switch (i) {
|
|
147
|
+
case buffer.length + 5: {
|
|
148
|
+
const x = (getByte(buffer[i - 7], alphabet) << 19) |
|
|
149
|
+
(getByte(buffer[i - 6], alphabet) << 14);
|
|
150
|
+
buffer[o++] = x >> 16;
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
case buffer.length + 3: {
|
|
154
|
+
const x = (getByte(buffer[i - 7], alphabet) << 19) |
|
|
155
|
+
(getByte(buffer[i - 6], alphabet) << 14) |
|
|
156
|
+
(getByte(buffer[i - 5], alphabet) << 9) |
|
|
157
|
+
(getByte(buffer[i - 4], alphabet) << 4);
|
|
158
|
+
buffer[o++] = x >> 16;
|
|
159
|
+
buffer[o++] = x >> 8 & 0xFF;
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
case buffer.length + 2: {
|
|
163
|
+
let x = (getByte(buffer[i - 7], alphabet) << 19) |
|
|
164
|
+
(getByte(buffer[i - 6], alphabet) << 14) |
|
|
165
|
+
(getByte(buffer[i - 5], alphabet) << 9) |
|
|
166
|
+
(getByte(buffer[i - 4], alphabet) << 4);
|
|
167
|
+
buffer[o++] = x >> 16;
|
|
168
|
+
buffer[o++] = x >> 8 & 0xFF;
|
|
169
|
+
x = (x << 16) |
|
|
170
|
+
(getByte(buffer[i - 3], alphabet) << 15);
|
|
171
|
+
buffer[o++] = x >> 16 & 0xFF;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
case buffer.length: {
|
|
175
|
+
let x = (getByte(buffer[i - 7], alphabet) << 19) |
|
|
176
|
+
(getByte(buffer[i - 6], alphabet) << 14) |
|
|
177
|
+
(getByte(buffer[i - 5], alphabet) << 9) |
|
|
178
|
+
(getByte(buffer[i - 4], alphabet) << 4);
|
|
179
|
+
buffer[o++] = x >> 16;
|
|
180
|
+
buffer[o++] = x >> 8 & 0xFF;
|
|
181
|
+
x = (x << 16) |
|
|
182
|
+
(getByte(buffer[i - 3], alphabet) << 15) |
|
|
183
|
+
(getByte(buffer[i - 2], alphabet) << 10) |
|
|
184
|
+
(getByte(buffer[i - 1], alphabet) << 5);
|
|
185
|
+
buffer[o++] = x >> 16 & 0xFF;
|
|
186
|
+
buffer[o++] = x >> 8 & 0xFF;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return o;
|
|
191
|
+
}
|
|
192
|
+
function getByte(char, alphabet) {
|
|
193
|
+
const byte = alphabet[char] ?? 32;
|
|
194
|
+
if (byte === 32) { // alphabet.Base32.length
|
|
195
|
+
throw new TypeError(`Cannot decode input as base32: Invalid character (${String.fromCharCode(char)})`);
|
|
196
|
+
}
|
|
197
|
+
return byte;
|
|
198
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_validate_binary_like.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.10/_validate_binary_like.ts"],"names":[],"mappings":"AAeA,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,UAAU,CAa9D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.validateBinaryLike = validateBinaryLike;
|
|
5
|
+
const encoder = new TextEncoder();
|
|
6
|
+
function getTypeName(value) {
|
|
7
|
+
const type = typeof value;
|
|
8
|
+
if (type !== "object") {
|
|
9
|
+
return type;
|
|
10
|
+
}
|
|
11
|
+
else if (value === null) {
|
|
12
|
+
return "null";
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
return value?.constructor?.name ?? "object";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function validateBinaryLike(source) {
|
|
19
|
+
if (typeof source === "string") {
|
|
20
|
+
return encoder.encode(source);
|
|
21
|
+
}
|
|
22
|
+
else if (source instanceof Uint8Array) {
|
|
23
|
+
return source;
|
|
24
|
+
}
|
|
25
|
+
else if (source instanceof ArrayBuffer) {
|
|
26
|
+
return new Uint8Array(source);
|
|
27
|
+
}
|
|
28
|
+
throw new TypeError(`Cannot validate the input as it must be a Uint8Array, a string, or an ArrayBuffer: received a value of the type ${getTypeName(source)}`);
|
|
29
|
+
}
|