create-mikstack 0.1.14 → 0.1.16
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/package.json
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
import { createForm } from "@mikstack/form";
|
|
14
14
|
import { dropAllDatabases } from "@rocicorp/zero";
|
|
15
15
|
import * as v from "valibot";
|
|
16
|
-
import { goto } from "$app/navigation";
|
|
17
16
|
import { resolve } from "$app/paths";
|
|
18
17
|
import { authClient } from "$lib/auth-client";
|
|
19
18
|
import { get_z } from "$lib/z.svelte";
|
|
@@ -86,7 +85,7 @@
|
|
|
86
85
|
async function signOut() {
|
|
87
86
|
await authClient.signOut();
|
|
88
87
|
await dropAllDatabases();
|
|
89
|
-
|
|
88
|
+
window.location.href = resolve("/sign-in");
|
|
90
89
|
}
|
|
91
90
|
</script>
|
|
92
91
|
|
|
@@ -130,6 +129,12 @@
|
|
|
130
129
|
id="{createNoteForm.id}-content"
|
|
131
130
|
oninput={(e) =>
|
|
132
131
|
createNoteForm.fields.content.set((e.target as HTMLTextAreaElement).value)}
|
|
132
|
+
onkeydown={(e) => {
|
|
133
|
+
if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
|
|
134
|
+
e.preventDefault();
|
|
135
|
+
document.getElementById(createNoteForm.id)?.requestSubmit();
|
|
136
|
+
}
|
|
137
|
+
}}
|
|
133
138
|
value={createNoteForm.fields.content.value() as string}
|
|
134
139
|
placeholder="Write something..."
|
|
135
140
|
/>
|
|
@@ -141,7 +146,7 @@
|
|
|
141
146
|
|
|
142
147
|
<Button type="submit" disabled={createNoteForm.pending}>
|
|
143
148
|
<Plus size={16} weight="bold" />
|
|
144
|
-
{createNoteForm.pending ? "Creating..." : "Create note"}
|
|
149
|
+
{createNoteForm.pending ? "Creating..." : "Create note"} <kbd>Ctrl+Enter</kbd>
|
|
145
150
|
</Button>
|
|
146
151
|
</form>
|
|
147
152
|
</section>
|
|
@@ -179,6 +184,12 @@
|
|
|
179
184
|
id="{editForm.id}-content"
|
|
180
185
|
oninput={(e) =>
|
|
181
186
|
editForm.fields.content.set((e.target as HTMLTextAreaElement).value)}
|
|
187
|
+
onkeydown={(e) => {
|
|
188
|
+
if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
|
|
189
|
+
e.preventDefault();
|
|
190
|
+
document.getElementById(editForm.id)?.requestSubmit();
|
|
191
|
+
}
|
|
192
|
+
}}
|
|
182
193
|
value={editForm.fields.content.value() as string}
|
|
183
194
|
/>
|
|
184
195
|
</FormField>
|