mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-08-04 18:48:12 +00:00

* feat: add paste API to extension API * feat(desktop): enhance clipboard and hotkey utilities - Add `hideAndPaste` utility function to simplify window hiding and clipboard pasting - Adjust key press and sleep timings for more reliable input simulation - Implement window focus listener in clipboard extension - Bind input element reference for automatic focus management * feat(permissions): enhance clipboard permission handling - Update clipboard permission schema to include paste permission - Modify clipboard API to check for paste permission before executing - Refactor permission map and schema for more flexible permission management * feat(desktop): refactor extension command search and rendering - Add `svelte-inspect-value` for debugging - Implement new `ExtCmds` component to replace `ExtCmdsGroup` - Enhance extension command search with separate Fuse.js instances for installed and dev extensions - Simplify extension command filtering and rendering logic - Add derived stores for extension commands with improved type safety * feat(desktop): improve extension command search filtering * bump @kksh/api version * feat(permissions): add clipboard paste permission description
30 lines
601 B
Svelte
30 lines
601 B
Svelte
<script lang="ts">
|
|
import { base } from '$app/paths';
|
|
import { clipboard, notification, ui, toast, dialog, shell } from '@kksh/api/ui/custom';
|
|
import {
|
|
ModeToggle,
|
|
Button,
|
|
Command,
|
|
ModeWatcher,
|
|
Separator,
|
|
ThemeWrapper,
|
|
updateTheme
|
|
} from '@kksh/svelte5';
|
|
import { onMount } from 'svelte';
|
|
|
|
async function paste() {
|
|
await clipboard
|
|
.paste()
|
|
.then(() => {
|
|
console.log('pasted');
|
|
})
|
|
.catch((err) => {
|
|
console.error(err);
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<div data-kunkun-drag-region class="h-12"></div>
|
|
<div class="container">
|
|
<Button onclick={paste}>Paste</Button>
|
|
</div>
|