mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-20 13:39:15 +00:00

* remove supabase package * upgrade valibot * removed supabase package Migration not complete yet * update submodule * fixed some supabase errors * Add new fields to extension models - Added `id` field to `ExtPublish` - Expanded `DBExtension` with multiple new properties: - `api_version`, `author_id`, `created_at`, - `downloads`, `icon`, `identifier`, - `long_description`, `name`, - `readme`, `short_description`, - and `tarball_size` * Refactor: clean up unused Supabase imports - Removed commented-out Supabase imports from various files to streamline the codebase. - Updated `created_at` type in `ExtPublish` model from `date` to `string` for consistency. * update icon enum to union * fix type errors after removing supabase * format * more types fixed * feat: enhance command handling and update SDK version
42 lines
2.0 KiB
TypeScript
42 lines
2.0 KiB
TypeScript
import type { TitleBarStyle, WindowConfig } from "@kksh/api/models"
|
|
import { TitleBarStyleEnum } from "@kksh/api/models"
|
|
import { WebviewWindow } from "@tauri-apps/api/webviewWindow"
|
|
|
|
export function launchNewExtWindow(windowLabel: string, url: string, windowConfig?: WindowConfig) {
|
|
return new WebviewWindow(windowLabel, {
|
|
center: windowConfig?.center ?? undefined,
|
|
x: windowConfig?.x ?? undefined,
|
|
y: windowConfig?.y ?? undefined,
|
|
width: windowConfig?.width ?? undefined,
|
|
height: windowConfig?.height ?? undefined,
|
|
minWidth: windowConfig?.minWidth ?? undefined,
|
|
minHeight: windowConfig?.minHeight ?? undefined,
|
|
maxWidth: windowConfig?.maxWidth ?? undefined,
|
|
maxHeight: windowConfig?.maxHeight ?? undefined,
|
|
resizable: windowConfig?.resizable ?? undefined,
|
|
title: windowConfig?.title ?? "Kunkun Extension",
|
|
fullscreen: windowConfig?.fullscreen ?? undefined,
|
|
focus: windowConfig?.focus ?? undefined,
|
|
transparent: windowConfig?.transparent ?? undefined,
|
|
maximized: windowConfig?.maximized ?? undefined,
|
|
visible: windowConfig?.visible ?? false, // default to false to avoid flickering
|
|
decorations: windowConfig?.decorations ?? undefined,
|
|
alwaysOnTop: windowConfig?.alwaysOnTop ?? undefined,
|
|
alwaysOnBottom: windowConfig?.alwaysOnBottom ?? undefined,
|
|
contentProtected: windowConfig?.contentProtected ?? undefined,
|
|
skipTaskbar: windowConfig?.skipTaskbar ?? undefined,
|
|
shadow: windowConfig?.shadow ?? undefined,
|
|
// theme: windowConfig?.theme ?? undefined,
|
|
titleBarStyle:
|
|
(windowConfig?.titleBarStyle as keyof typeof TitleBarStyleEnum | undefined) ?? undefined,
|
|
hiddenTitle: windowConfig?.hiddenTitle ?? undefined,
|
|
tabbingIdentifier: windowConfig?.tabbingIdentifier ?? undefined,
|
|
maximizable: windowConfig?.maximizable ?? undefined,
|
|
minimizable: windowConfig?.minimizable ?? undefined,
|
|
closable: windowConfig?.closable ?? undefined,
|
|
parent: windowConfig?.parent ?? undefined,
|
|
visibleOnAllWorkspaces: windowConfig?.visibleOnAllWorkspaces ?? undefined,
|
|
url
|
|
})
|
|
}
|