Huakun Shen ed87fc6c12
App Setup (#2)
* chore: add vendor submodules

* feat: add packages for db,ci,schema,api,jarvis cmds

* feat: add tauri-jarvis-plugin

* feat: implement extension commands list

* fix(desktop): import path errors after packages refactor

* chore: add self signed cert

* fix: prevent prerender for desktop

* fix(desktop): desktop sveltekit static build, use csr for dynamic route

* feat: add error handling page and components

* refactor: component lib

* refactor: move more types, functions and components out of desktop

* refactor(ui): more refactor

* refactor(ui): move store components to @kksh/ui

* ci: add CI for build & test

* refactor: rename @kksh/extensions to @kksh/extension

* ci: add 2 more ci

* ci: fix

* fix: CI env var

* chore: add changeset

* feat: implement extension store item detail view

* feat: implement extension store install, uninstall, upgrade

* format

* revert: upgradable logic, the new one doesn't work yet

* refactor: make @kksh/ui dependent only on @kksh/api

Reason: @kksh/ui may be published later for building website, all its dependency packages must be also published. To avoid trouble it should be standalone, depend only on packages already published

* refactor: cleanup

* fixed: some typescript error

* chore: got typedoc working on @kksh/api

* ci: disable manifest schema upload CI on push
2024-11-03 13:54:44 -05:00

40 lines
1.9 KiB
TypeScript

import type { WindowConfig } 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 ?? undefined,
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 ?? 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
})
}