mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-11 17:29:44 +00:00
Refactor: rename api subpackage (#93)
* refactor(api): rename ui subpackage name * refactor(api): update import paths for template UI schemas * chore: update dependencies and bump package versions * chore(api): bump package version to 0.1.1 * refactor(api): rename IUiIframe to IUiCustom and related types * format
This commit is contained in:
parent
872bcfdfd1
commit
f37605f9a2
@ -1,5 +1,12 @@
|
|||||||
# kksh
|
# kksh
|
||||||
|
|
||||||
|
## 0.0.32
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.1
|
||||||
|
|
||||||
## 0.0.31
|
## 0.0.31
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "kksh",
|
"name": "kksh",
|
||||||
"module": "dist/cli.js",
|
"module": "dist/cli.js",
|
||||||
"version": "0.0.31",
|
"version": "0.0.32",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": {
|
"bin": {
|
||||||
"kksh": "./dist/cli.js",
|
"kksh": "./dist/cli.js",
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# create-kunkun
|
# create-kunkun
|
||||||
|
|
||||||
|
## 0.1.44
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.1
|
||||||
|
|
||||||
## 0.1.43
|
## 0.1.43
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "create-kunkun",
|
"name": "create-kunkun",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.1.43",
|
"version": "0.1.44",
|
||||||
"bin": {
|
"bin": {
|
||||||
"create-kunkun": "dist/index.mjs"
|
"create-kunkun": "dist/index.mjs"
|
||||||
},
|
},
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
constructJarvisServerAPIWithPermissions,
|
constructJarvisServerAPIWithPermissions,
|
||||||
// exposeApiToWindow,
|
// exposeApiToWindow,
|
||||||
type IApp,
|
type IApp,
|
||||||
type IUiIframe
|
type IUiCustom
|
||||||
} from "@kksh/api/ui"
|
} from "@kksh/api/ui"
|
||||||
import { toast, type IUiIframeServer1, type IUiIframeServer2 } from "@kksh/api/ui/iframe"
|
import { toast, type IUiCustomServer1, type IUiCustomServer2 } from "@kksh/api/ui/custom"
|
||||||
import { Button } from "@kksh/svelte5"
|
import { Button } from "@kksh/svelte5"
|
||||||
import { cn } from "@kksh/ui/utils"
|
import { cn } from "@kksh/ui/utils"
|
||||||
import type { IKunkunFullServerAPI } from "@kunkunapi/src/api/server"
|
import type { IKunkunFullServerAPI } from "@kunkunapi/src/api/server"
|
||||||
@ -49,7 +49,7 @@
|
|||||||
transparentBg: false
|
transparentBg: false
|
||||||
})
|
})
|
||||||
|
|
||||||
const iframeUiAPI: IUiIframeServer2 = {
|
const iframeUiAPI: IUiCustomServer2 = {
|
||||||
goBack: async () => {
|
goBack: async () => {
|
||||||
if (isInMainWindow()) {
|
if (isInMainWindow()) {
|
||||||
goto(i18n.resolveRoute("/app/"))
|
goto(i18n.resolveRoute("/app/"))
|
||||||
@ -113,7 +113,7 @@
|
|||||||
iframeUi: {
|
iframeUi: {
|
||||||
...serverAPI.iframeUi,
|
...serverAPI.iframeUi,
|
||||||
...iframeUiAPI
|
...iframeUiAPI
|
||||||
} satisfies IUiIframeServer1 & IUiIframeServer2,
|
} satisfies IUiCustomServer1 & IUiCustomServer2,
|
||||||
db: new db.JarvisExtDB(extInfoInDB.extId),
|
db: new db.JarvisExtDB(extInfoInDB.extId),
|
||||||
kv: new db.KV(extInfoInDB.extId),
|
kv: new db.KV(extInfoInDB.extId),
|
||||||
app: {
|
app: {
|
||||||
|
@ -6,7 +6,11 @@
|
|||||||
import { listenToFileDrop, listenToRefreshDevExt } from "@/utils/tauri-events.js"
|
import { listenToFileDrop, listenToRefreshDevExt } from "@/utils/tauri-events.js"
|
||||||
import { isInMainWindow } from "@/utils/window.js"
|
import { isInMainWindow } from "@/utils/window.js"
|
||||||
import { db } from "@kksh/api/commands"
|
import { db } from "@kksh/api/commands"
|
||||||
import { constructJarvisServerAPIWithPermissions, type IApp, type IUiWorker } from "@kksh/api/ui"
|
import {
|
||||||
|
constructJarvisServerAPIWithPermissions,
|
||||||
|
type IApp,
|
||||||
|
type IUiTemplate
|
||||||
|
} from "@kksh/api/ui"
|
||||||
import {
|
import {
|
||||||
FormNodeNameEnum,
|
FormNodeNameEnum,
|
||||||
FormSchema,
|
FormSchema,
|
||||||
@ -16,7 +20,7 @@
|
|||||||
toast,
|
toast,
|
||||||
type IComponent,
|
type IComponent,
|
||||||
type TemplateUiCommand
|
type TemplateUiCommand
|
||||||
} from "@kksh/api/ui/worker"
|
} from "@kksh/api/ui/template"
|
||||||
import { LoadingBar } from "@kksh/ui"
|
import { LoadingBar } from "@kksh/ui"
|
||||||
import { Templates } from "@kksh/ui/extension"
|
import { Templates } from "@kksh/ui/extension"
|
||||||
import { GlobalCommandPaletteFooter } from "@kksh/ui/main"
|
import { GlobalCommandPaletteFooter } from "@kksh/ui/main"
|
||||||
@ -73,7 +77,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const extUiAPI: IUiWorker = {
|
const extUiAPI: IUiTemplate = {
|
||||||
async render(view: IComponent<ListSchema.List | FormSchema.Form | MarkdownSchema>) {
|
async render(view: IComponent<ListSchema.List | FormSchema.Form | MarkdownSchema>) {
|
||||||
if (view.nodeName === NodeNameEnum.List) {
|
if (view.nodeName === NodeNameEnum.List) {
|
||||||
clearViewContent("list")
|
clearViewContent("list")
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
# @kksh/api
|
# @kksh/api
|
||||||
|
|
||||||
|
## 0.1.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Rename api's 2 ui subpackage to less technical terms; iframe to custom and worker to template
|
||||||
|
|
||||||
## 0.1.0
|
## 0.1.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://jsr.io/schema/config-file.v1.json",
|
"$schema": "https://jsr.io/schema/config-file.v1.json",
|
||||||
"name": "@kunkun/api",
|
"name": "@kunkun/api",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts",
|
".": "./src/index.ts",
|
||||||
"./ui": "./src/ui/index.ts",
|
"./ui": "./src/ui/index.ts",
|
||||||
"./ui/iframe": "./src/ui/iframe/index.ts",
|
"./ui/custom": "./src/ui/custom/index.ts",
|
||||||
"./ui/worker": "./src/ui/worker/index.ts",
|
"./ui/template": "./src/ui/template/index.ts",
|
||||||
"./headless": "./src/headless/index.ts",
|
"./headless": "./src/headless/index.ts",
|
||||||
"./models": "./src/models/index.ts",
|
"./models": "./src/models/index.ts",
|
||||||
"./commands": "./src/commands/index.ts",
|
"./commands": "./src/commands/index.ts",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kksh/api",
|
"name": "@kksh/api",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -12,8 +12,8 @@
|
|||||||
"exports": {
|
"exports": {
|
||||||
".": "./src/index.ts",
|
".": "./src/index.ts",
|
||||||
"./ui": "./src/ui/index.ts",
|
"./ui": "./src/ui/index.ts",
|
||||||
"./ui/iframe": "./src/ui/iframe/index.ts",
|
"./ui/custom": "./src/ui/custom/index.ts",
|
||||||
"./ui/worker": "./src/ui/worker/index.ts",
|
"./ui/template": "./src/ui/template/index.ts",
|
||||||
"./headless": "./src/headless/index.ts",
|
"./headless": "./src/headless/index.ts",
|
||||||
"./models": "./src/models/index.ts",
|
"./models": "./src/models/index.ts",
|
||||||
"./commands": "./src/commands/index.ts",
|
"./commands": "./src/commands/index.ts",
|
||||||
|
@ -111,7 +111,7 @@ export interface IToast {
|
|||||||
error: GeneralToast
|
error: GeneralToast
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IUiIframe {
|
export interface IUiCustom {
|
||||||
// goHome: () => Promise<void>
|
// goHome: () => Promise<void>
|
||||||
goBack: () => Promise<void>
|
goBack: () => Promise<void>
|
||||||
hideBackButton: () => Promise<void>
|
hideBackButton: () => Promise<void>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
// import type { Remote } from "@huakunshen/comlink"
|
// import type { Remote } from "@huakunshen/comlink"
|
||||||
import type { IOs } from "tauri-api-adapter/client"
|
import type { IOs } from "tauri-api-adapter/client"
|
||||||
import { type IUiIframe } from "./client"
|
import { type IUiCustom } from "./client"
|
||||||
|
|
||||||
export const KK_DRAG_REGION_ATTR = "data-kunkun-drag-region"
|
export const KK_DRAG_REGION_ATTR = "data-kunkun-drag-region"
|
||||||
|
|
||||||
export function constructIframeUiAPI(api: { iframeUi: IUiIframe; os: IOs }): IUiIframe {
|
export function constructIframeUiAPI(api: { iframeUi: IUiCustom; os: IOs }): IUiCustom {
|
||||||
return {
|
return {
|
||||||
goBack: api.iframeUi.goBack,
|
goBack: api.iframeUi.goBack,
|
||||||
hideBackButton: api.iframeUi.hideBackButton,
|
hideBackButton: api.iframeUi.hideBackButton,
|
||||||
|
@ -6,7 +6,7 @@ import type {
|
|||||||
IOPayload,
|
IOPayload,
|
||||||
SpawnOptions
|
SpawnOptions
|
||||||
} from "tauri-plugin-shellx-api"
|
} from "tauri-plugin-shellx-api"
|
||||||
import type { DenoRunConfig, IUiIframe } from "./client"
|
import type { DenoRunConfig, IUiCustom } from "./client"
|
||||||
|
|
||||||
export type IShellServer = IShellServer1 & {
|
export type IShellServer = IShellServer1 & {
|
||||||
denoExecute(
|
denoExecute(
|
||||||
@ -25,13 +25,13 @@ export type IShellServer = IShellServer1 & {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This will be implemented in the @kksh/api package
|
// This will be implemented in the @kksh/api package
|
||||||
export type IUiIframeServer1 = Pick<
|
export type IUiCustomServer1 = Pick<
|
||||||
IUiIframe,
|
IUiCustom,
|
||||||
"startDragging" | "toggleMaximize" | "internalToggleMaximize"
|
"startDragging" | "toggleMaximize" | "internalToggleMaximize"
|
||||||
>
|
>
|
||||||
// This interface will be implemented in iframe-ext.vue where iframe is loaded and API is exposed
|
// This interface will be implemented in iframe-ext.vue where iframe is loaded and API is exposed
|
||||||
// because these API dependes on the context of the page
|
// because these API dependes on the context of the page
|
||||||
export type IUiIframeServer2 = Omit<
|
export type IUiCustomServer2 = Omit<
|
||||||
IUiIframe,
|
IUiCustom,
|
||||||
"registerDragRegion" | "internalToggleMaximize" | "toggleMaximize" | "startDragging"
|
"registerDragRegion" | "internalToggleMaximize" | "toggleMaximize" | "startDragging"
|
||||||
>
|
>
|
||||||
|
@ -38,7 +38,7 @@ import {
|
|||||||
type UpdownloadPermission
|
type UpdownloadPermission
|
||||||
} from "tauri-api-adapter/permissions"
|
} from "tauri-api-adapter/permissions"
|
||||||
import type { IEvent, IFs, IOpen, ISecurity, ISystem, IToast, IUtils } from "../../api/client"
|
import type { IEvent, IFs, IOpen, ISecurity, ISystem, IToast, IUtils } from "../../api/client"
|
||||||
import type { IUiIframeServer1 } from "../../api/server-types"
|
import type { IUiCustomServer1 } from "../../api/server-types"
|
||||||
import {
|
import {
|
||||||
AllKunkunPermission,
|
AllKunkunPermission,
|
||||||
type EventPermission,
|
type EventPermission,
|
||||||
@ -65,8 +65,8 @@ import {
|
|||||||
} from "./toast"
|
} from "./toast"
|
||||||
import {
|
import {
|
||||||
constructIframeUiApi
|
constructIframeUiApi
|
||||||
// type IUiIframeServer,
|
// type IUiCustomServer,
|
||||||
// type IUiWorkerServer
|
// type IUiTemplateServer
|
||||||
} from "./ui"
|
} from "./ui"
|
||||||
import { constructUtilsApi } from "./utils"
|
import { constructUtilsApi } from "./utils"
|
||||||
|
|
||||||
@ -79,13 +79,13 @@ export {
|
|||||||
} from "./toast"
|
} from "./toast"
|
||||||
export {
|
export {
|
||||||
constructIframeUiApi
|
constructIframeUiApi
|
||||||
// type IUiIframeServer,
|
// type IUiCustomServer,
|
||||||
// type IUiWorkerServer
|
// type IUiTemplateServer
|
||||||
} from "./ui"
|
} from "./ui"
|
||||||
|
|
||||||
// export type IJarvisFullAPI =
|
// export type IJarvisFullAPI =
|
||||||
// // IFullAPI &
|
// // IFullAPI &
|
||||||
// ISystemServer & IToastServer & IDbServer & IUiWorkerServer & IUiIframeServer & IFsServer // IFsServer will override some methods in IFullAPI, it's fine because it's a superset
|
// ISystemServer & IToastServer & IDbServer & IUiTemplateServer & IUiCustomServer & IFsServer // IFsServer will override some methods in IFullAPI, it's fine because it's a superset
|
||||||
type AllScopedPermissions = FsPermissionScoped | OpenPermissionScoped | ShellPermissionScoped
|
type AllScopedPermissions = FsPermissionScoped | OpenPermissionScoped | ShellPermissionScoped
|
||||||
type AllPermissions = AllKunkunPermission | AllScopedPermissions
|
type AllPermissions = AllKunkunPermission | AllScopedPermissions
|
||||||
function getStringPermissions(permissions: AllPermissions[]): AllKunkunPermission[] {
|
function getStringPermissions(permissions: AllPermissions[]): AllKunkunPermission[] {
|
||||||
@ -113,7 +113,7 @@ export type IKunkunFullServerAPI = {
|
|||||||
system: ISystem
|
system: ISystem
|
||||||
toast: IToast
|
toast: IToast
|
||||||
shell: IShellServer
|
shell: IShellServer
|
||||||
iframeUi: IUiIframeServer1
|
iframeUi: IUiCustomServer1
|
||||||
utils: IUtils
|
utils: IUtils
|
||||||
security: ISecurity
|
security: ISecurity
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { invoke } from "@tauri-apps/api/core"
|
import { invoke } from "@tauri-apps/api/core"
|
||||||
import { getCurrentWindow } from "@tauri-apps/api/window"
|
import { getCurrentWindow } from "@tauri-apps/api/window"
|
||||||
import type { IUiIframeServer1 } from "../../api/server-types"
|
import type { IUiCustomServer1 } from "../../api/server-types"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Other APIs will be constructed in main window as they are used to manipulate UI directly
|
* Other APIs will be constructed in main window as they are used to manipulate UI directly
|
||||||
* We can't access UI from here
|
* We can't access UI from here
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function constructIframeUiApi(): IUiIframeServer1 {
|
export function constructIframeUiApi(): IUiCustomServer1 {
|
||||||
return {
|
return {
|
||||||
startDragging: () => {
|
startDragging: () => {
|
||||||
return getCurrentWindow().startDragging()
|
return getCurrentWindow().startDragging()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// import { proxy, type Remote } from "@huakunshen/comlink"
|
// import { proxy, type Remote } from "@huakunshen/comlink"
|
||||||
// import type { IUiWorker } from "../client"
|
// import type { IUiTemplate } from "../client"
|
||||||
|
|
||||||
// export function constructWorkerUiAPI(api: Remote<IUiWorker>): IUiWorker {
|
// export function constructWorkerUiAPI(api: Remote<IUiTemplate>): IUiTemplate {
|
||||||
// return {
|
// return {
|
||||||
// goBack: api.goBack,
|
// goBack: api.goBack,
|
||||||
// render: api.render,
|
// render: api.render,
|
||||||
|
@ -51,7 +51,7 @@ export type {
|
|||||||
IUpdownload,
|
IUpdownload,
|
||||||
IFetch
|
IFetch
|
||||||
} from "tauri-api-adapter"
|
} from "tauri-api-adapter"
|
||||||
export type { ISystem, IToast, IUiIframe, IDb, IKV, IFs, IOpen, IEvent } from "../api/client"
|
export type { ISystem, IToast, IUiCustom, IDb, IKV, IFs, IOpen, IEvent } from "../api/client"
|
||||||
export type { IShell } from "../api/shell"
|
export type { IShell } from "../api/shell"
|
||||||
export { HeadlessCommand } from "./ext"
|
export { HeadlessCommand } from "./ext"
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export * as List from "../ui/worker/schema/list"
|
export * as List from "../ui/template/schema/list"
|
||||||
export * as Action from "../ui/worker/schema/action"
|
export * as Action from "../ui/template/schema/action"
|
||||||
export * from "./constants"
|
export * from "./constants"
|
||||||
export * from "./icon"
|
export * from "./icon"
|
||||||
export * from "./apps"
|
export * from "./apps"
|
||||||
@ -9,7 +9,7 @@ export * from "./manifest"
|
|||||||
export * from "./styles"
|
export * from "./styles"
|
||||||
export * from "./mdns"
|
export * from "./mdns"
|
||||||
export { AllKunkunPermission, SystemPermissionSchema } from "../permissions"
|
export { AllKunkunPermission, SystemPermissionSchema } from "../permissions"
|
||||||
export { Markdown as MarkdownSchema } from "../ui/worker/schema/markdown"
|
export { Markdown as MarkdownSchema } from "../ui/template/schema/markdown"
|
||||||
export * as ListSchema from "../ui/worker/schema/list"
|
export * as ListSchema from "../ui/template/schema/list"
|
||||||
export * as FormSchema from "../ui/worker/schema/form"
|
export * as FormSchema from "../ui/template/schema/form"
|
||||||
export * from "./file-transfer"
|
export * from "./file-transfer"
|
||||||
|
@ -31,7 +31,7 @@ import type {
|
|||||||
ISecurity,
|
ISecurity,
|
||||||
ISystem,
|
ISystem,
|
||||||
IToast,
|
IToast,
|
||||||
IUiIframe,
|
IUiCustom,
|
||||||
IUtils
|
IUtils
|
||||||
} from "../../api/client"
|
} from "../../api/client"
|
||||||
import { constructEventAPI } from "../../api/event"
|
import { constructEventAPI } from "../../api/event"
|
||||||
@ -40,10 +40,10 @@ import { constructPathAPI } from "../../api/path"
|
|||||||
import type { IShellServer } from "../../api/server-types"
|
import type { IShellServer } from "../../api/server-types"
|
||||||
import { constructShellAPI } from "../../api/shell"
|
import { constructShellAPI } from "../../api/shell"
|
||||||
|
|
||||||
export { type IUiIframe } from "../../api/client"
|
export { type IUiCustom } from "../../api/client"
|
||||||
// export { expose, wrap } from "@huakunshen/comlink"
|
// export { expose, wrap } from "@huakunshen/comlink"
|
||||||
// export { type IDbServer } from "../server/db"
|
// export { type IDbServer } from "../server/db"
|
||||||
export { type IUiIframeServer2, type IUiIframeServer1 } from "../../api/server-types"
|
export { type IUiCustomServer2, type IUiCustomServer1 } from "../../api/server-types"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For the APIs annotated with "inherit from tauri-api-adapter", they inherit the client API completely from tauri-api-adapter
|
* For the APIs annotated with "inherit from tauri-api-adapter", they inherit the client API completely from tauri-api-adapter
|
||||||
@ -68,7 +68,7 @@ type API = {
|
|||||||
updownload: IUpdownload // inherit from tauri-api-adapter
|
updownload: IUpdownload // inherit from tauri-api-adapter
|
||||||
sysInfo: ISystemInfo // inherit from tauri-api-adapter
|
sysInfo: ISystemInfo // inherit from tauri-api-adapter
|
||||||
network: INetwork // inherit from tauri-api-adapter
|
network: INetwork // inherit from tauri-api-adapter
|
||||||
iframeUi: IUiIframe // for kunkun
|
iframeUi: IUiCustom // for kunkun
|
||||||
utils: IUtils // for kunkun
|
utils: IUtils // for kunkun
|
||||||
security: ISecurity // for kunkun
|
security: ISecurity // for kunkun
|
||||||
app: IApp
|
app: IApp
|
@ -19,5 +19,5 @@ export type {
|
|||||||
IFetch
|
IFetch
|
||||||
} from "tauri-api-adapter"
|
} from "tauri-api-adapter"
|
||||||
export * from "../api/client" // all client types
|
export * from "../api/client" // all client types
|
||||||
export type { IUiWorker } from "./worker"
|
export type { IUiTemplate } from "./template"
|
||||||
export type { IShell } from "../api/shell"
|
export type { IShell } from "../api/shell"
|
||||||
|
@ -47,7 +47,7 @@ import type { FormSchema, ListSchema, MarkdownSchema } from "../../models"
|
|||||||
import type { IComponent } from "./components"
|
import type { IComponent } from "./components"
|
||||||
import type { TemplateUiCommand } from "./ext"
|
import type { TemplateUiCommand } from "./ext"
|
||||||
|
|
||||||
export interface IUiWorker {
|
export interface IUiTemplate {
|
||||||
render: (view: IComponent<ListSchema.List | FormSchema.Form | MarkdownSchema>) => Promise<void>
|
render: (view: IComponent<ListSchema.List | FormSchema.Form | MarkdownSchema>) => Promise<void>
|
||||||
goBack: () => Promise<void>
|
goBack: () => Promise<void>
|
||||||
showLoadingBar: (loading: boolean) => Promise<void>
|
showLoadingBar: (loading: boolean) => Promise<void>
|
||||||
@ -82,7 +82,7 @@ type API = {
|
|||||||
updownload: IUpdownload // inherit from tauri-api-adapter
|
updownload: IUpdownload // inherit from tauri-api-adapter
|
||||||
sysInfo: ISystemInfo // inherit from tauri-api-adapter
|
sysInfo: ISystemInfo // inherit from tauri-api-adapter
|
||||||
network: INetwork // inherit from tauri-api-adapter
|
network: INetwork // inherit from tauri-api-adapter
|
||||||
workerUi: IUiWorker // for kunkun
|
workerUi: IUiTemplate // for kunkun
|
||||||
security: ISecurity // for kunkun
|
security: ISecurity // for kunkun
|
||||||
utils: IUtils // for kunkun
|
utils: IUtils // for kunkun
|
||||||
app: IApp
|
app: IApp
|
@ -3,8 +3,8 @@
|
|||||||
"entryPoints": [
|
"entryPoints": [
|
||||||
"src/index.ts",
|
"src/index.ts",
|
||||||
"src/ui/index.ts",
|
"src/ui/index.ts",
|
||||||
"src/ui/iframe/index.ts",
|
"src/ui/custom/index.ts",
|
||||||
"src/ui/worker/index.ts",
|
"src/ui/template/index.ts",
|
||||||
"src/models/index.ts",
|
"src/models/index.ts",
|
||||||
"src/commands/index.ts",
|
"src/commands/index.ts",
|
||||||
"src/ui/api/permissions.ts",
|
"src/ui/api/permissions.ts",
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# demo-template-extension
|
# demo-template-extension
|
||||||
|
|
||||||
|
## 0.0.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.1
|
||||||
|
|
||||||
## 0.0.7
|
## 0.0.7
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../../schema/manifest-json-schema.json",
|
"$schema": "../../schema/manifest-json-schema.json",
|
||||||
"name": "demo-template-extension",
|
"name": "demo-template-extension",
|
||||||
"version": "0.0.7",
|
"version": "0.0.8",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
|
@ -19,7 +19,7 @@ import {
|
|||||||
TemplateUiCommand,
|
TemplateUiCommand,
|
||||||
toast,
|
toast,
|
||||||
ui
|
ui
|
||||||
} from "@kksh/api/ui/worker"
|
} from "@kksh/api/ui/template"
|
||||||
import { IconType } from "@kunkun/api/models"
|
import { IconType } from "@kunkun/api/models"
|
||||||
|
|
||||||
const nums = Array.from({ length: 20 }, (_, i) => i + 1)
|
const nums = Array.from({ length: 20 }, (_, i) => i + 1)
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-sveltekit
|
# template-ext-sveltekit
|
||||||
|
|
||||||
|
## 0.0.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.1
|
||||||
|
|
||||||
## 0.0.7
|
## 0.0.7
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.kunkun.sh",
|
"$schema": "https://schema.kunkun.sh",
|
||||||
"name": "ext-sveltekit-exp",
|
"name": "ext-sveltekit-exp",
|
||||||
"version": "0.0.7",
|
"version": "0.0.8",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
"name": "TODO: Change Display Name",
|
"name": "TODO: Change Display Name",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ThemeCustomizerButton, type ThemeConfig, updateTheme } from '@kksh/svelte5';
|
import { ThemeCustomizerButton, type ThemeConfig, updateTheme } from '@kksh/svelte5';
|
||||||
import { ui } from '@kksh/api/ui/iframe';
|
import { ui } from '@kksh/api/ui/custom';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
let config: ThemeConfig = {
|
let config: ThemeConfig = {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import { ModeWatcher } from 'mode-watcher';
|
import { ModeWatcher } from 'mode-watcher';
|
||||||
import { ThemeWrapper, updateTheme } from '@kksh/svelte5';
|
import { ThemeWrapper, updateTheme } from '@kksh/svelte5';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { ui } from '@kksh/api/ui/iframe';
|
import { ui } from '@kksh/api/ui/custom';
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
ui.registerDragRegion();
|
ui.registerDragRegion();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { base } from '$app/paths';
|
import { base } from '$app/paths';
|
||||||
import { clipboard, notification, ui, toast, dialog, shell } from '@kksh/api/ui/iframe';
|
import { clipboard, notification, ui, toast, dialog, shell } from '@kksh/api/ui/custom';
|
||||||
import {
|
import {
|
||||||
ModeToggle,
|
ModeToggle,
|
||||||
Button,
|
Button,
|
||||||
|
@ -58,7 +58,7 @@ If you want to support i18n, you can use the `t` function to translate the strin
|
|||||||
User's language setting is available via `app.language()`.
|
User's language setting is available via `app.language()`.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { app } from "@kksh/api/ui/worker"
|
import { app } from "@kksh/api/ui/template"
|
||||||
import { setupI18n, t } from "./src/i18n"
|
import { setupI18n, t } from "./src/i18n"
|
||||||
|
|
||||||
setupI18n("zh")
|
setupI18n("zh")
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
TemplateUiCommand,
|
TemplateUiCommand,
|
||||||
toast,
|
toast,
|
||||||
ui
|
ui
|
||||||
} from "@kksh/api/ui/worker"
|
} from "@kksh/api/ui/template"
|
||||||
|
|
||||||
class ExtensionTemplate extends TemplateUiCommand {
|
class ExtensionTemplate extends TemplateUiCommand {
|
||||||
async onFormSubmit(value: Record<string, any>): Promise<void> {
|
async onFormSubmit(value: Record<string, any>): Promise<void> {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
## Permission Table
|
## Permission Table
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
@ -7,7 +6,6 @@
|
|||||||
<th>Description</th>
|
<th>Description</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-worker
|
# template-ext-worker
|
||||||
|
|
||||||
|
## 0.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.1
|
||||||
|
|
||||||
## 0.0.6
|
## 0.0.6
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -58,7 +58,7 @@ If you want to support i18n, you can use the `t` function to translate the strin
|
|||||||
User's language setting is available via `app.language()`.
|
User's language setting is available via `app.language()`.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { app } from "@kksh/api/ui/worker"
|
import { app } from "@kksh/api/ui/template"
|
||||||
import { setupI18n, t } from "./src/i18n"
|
import { setupI18n, t } from "./src/i18n"
|
||||||
|
|
||||||
setupI18n("zh")
|
setupI18n("zh")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-headless",
|
"name": "template-ext-headless",
|
||||||
"version": "0.0.6",
|
"version": "0.0.7",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-next
|
# template-ext-next
|
||||||
|
|
||||||
|
## 0.1.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.1
|
||||||
|
|
||||||
## 0.1.5
|
## 0.1.5
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-next",
|
"name": "template-ext-next",
|
||||||
"version": "0.1.5",
|
"version": "0.1.6",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
"name": "TODO: Change Display Name",
|
"name": "TODO: Change Display Name",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { ui } from "@kksh/api/ui/iframe"
|
import { ui } from "@kksh/api/ui/custom"
|
||||||
import { useEffect } from "react"
|
import { useEffect } from "react"
|
||||||
|
|
||||||
export default function About() {
|
export default function About() {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { ui } from "@kksh/api/ui/iframe"
|
import { ui } from "@kksh/api/ui/custom"
|
||||||
import { Button } from "@kksh/react"
|
import { Button } from "@kksh/react"
|
||||||
import { useEffect } from "react"
|
import { useEffect } from "react"
|
||||||
|
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-nuxt
|
# template-ext-nuxt
|
||||||
|
|
||||||
|
## 0.0.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.1
|
||||||
|
|
||||||
## 0.0.7
|
## 0.0.7
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-nuxt",
|
"name": "template-ext-nuxt",
|
||||||
"version": "0.0.7",
|
"version": "0.0.8",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ui } from "@kksh/api/ui/iframe"
|
import { ui } from "@kksh/api/ui/custom"
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Command,
|
Command,
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-react
|
# template-ext-react
|
||||||
|
|
||||||
|
## 0.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.1
|
||||||
|
|
||||||
## 0.0.6
|
## 0.0.6
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-react",
|
"name": "template-ext-react",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "0.0.6",
|
"version": "0.0.7",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
"name": "TODO: Change Display Name",
|
"name": "TODO: Change Display Name",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ui } from "@kksh/api/ui/iframe"
|
import { ui } from "@kksh/api/ui/custom"
|
||||||
import {
|
import {
|
||||||
ActionPanel,
|
ActionPanel,
|
||||||
Button,
|
Button,
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-svelte
|
# template-ext-svelte
|
||||||
|
|
||||||
|
## 0.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.1
|
||||||
|
|
||||||
## 0.0.6
|
## 0.0.6
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-svelte",
|
"name": "template-ext-svelte",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "0.0.6",
|
"version": "0.0.7",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
"name": "TODO: Change Display Name",
|
"name": "TODO: Change Display Name",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { notification, ui } from "@kksh/api/ui/iframe"
|
import { notification, ui } from "@kksh/api/ui/custom"
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Command,
|
Command,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ui } from "@kksh/api/ui/iframe"
|
import { ui } from "@kksh/api/ui/custom"
|
||||||
import { ThemeCustomizerButton, updateTheme, type ThemeConfig } from "@kksh/svelte5"
|
import { ThemeCustomizerButton, updateTheme, type ThemeConfig } from "@kksh/svelte5"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
|
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-sveltekit
|
# template-ext-sveltekit
|
||||||
|
|
||||||
|
## 0.0.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.1
|
||||||
|
|
||||||
## 0.0.7
|
## 0.0.7
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-sveltekit",
|
"name": "template-ext-sveltekit",
|
||||||
"version": "0.0.7",
|
"version": "0.0.8",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
"name": "TODO: Change Display Name",
|
"name": "TODO: Change Display Name",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ThemeCustomizerButton, type ThemeConfig, updateTheme } from '@kksh/svelte5';
|
import { ThemeCustomizerButton, type ThemeConfig, updateTheme } from '@kksh/svelte5';
|
||||||
import { ui } from '@kksh/api/ui/iframe';
|
import { ui } from '@kksh/api/ui/custom';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
let config: ThemeConfig = {
|
let config: ThemeConfig = {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
import { ModeWatcher } from 'mode-watcher';
|
import { ModeWatcher } from 'mode-watcher';
|
||||||
import { ThemeWrapper, updateTheme } from '@kksh/svelte5';
|
import { ThemeWrapper, updateTheme } from '@kksh/svelte5';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { ui } from '@kksh/api/ui/iframe';
|
import { ui } from '@kksh/api/ui/custom';
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
ui.registerDragRegion();
|
ui.registerDragRegion();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { base } from '$app/paths';
|
import { base } from '$app/paths';
|
||||||
import { clipboard, notification, ui, toast } from '@kksh/api/ui/iframe';
|
import { clipboard, notification, ui, toast } from '@kksh/api/ui/custom';
|
||||||
import { ModeToggle, Button, Command, Separator, updateTheme } from '@kksh/svelte5';
|
import { ModeToggle, Button, Command, Separator, updateTheme } from '@kksh/svelte5';
|
||||||
import ThemeCustomizer from '$lib/components/ThemeCustomizer.svelte';
|
import ThemeCustomizer from '$lib/components/ThemeCustomizer.svelte';
|
||||||
import {
|
import {
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-vue
|
# template-ext-vue
|
||||||
|
|
||||||
|
## 0.0.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.1
|
||||||
|
|
||||||
## 0.0.4
|
## 0.0.4
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "template-ext-vue",
|
"name": "template-ext-vue",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "0.0.4",
|
"version": "0.0.5",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { notification, toast, ui } from "@kksh/api/ui/iframe"
|
import { notification, toast, ui } from "@kksh/api/ui/custom"
|
||||||
import {
|
import {
|
||||||
Command,
|
Command,
|
||||||
CommandEmpty,
|
CommandEmpty,
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
# template-ext-worker
|
# template-ext-worker
|
||||||
|
|
||||||
|
## 0.0.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @kksh/api@0.1.1
|
||||||
|
|
||||||
## 0.0.6
|
## 0.0.6
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@ -58,7 +58,7 @@ If you want to support i18n, you can use the `t` function to translate the strin
|
|||||||
User's language setting is available via `app.language()`.
|
User's language setting is available via `app.language()`.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { app } from "@kksh/api/ui/worker"
|
import { app } from "@kksh/api/ui/template"
|
||||||
import { setupI18n, t } from "./src/i18n"
|
import { setupI18n, t } from "./src/i18n"
|
||||||
|
|
||||||
setupI18n("zh")
|
setupI18n("zh")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
"$schema": "./node_modules/@kksh/api/dist/schema.json",
|
||||||
"name": "template-ext-worker",
|
"name": "template-ext-worker",
|
||||||
"version": "0.0.6",
|
"version": "0.0.7",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"kunkun": {
|
"kunkun": {
|
||||||
|
@ -12,7 +12,7 @@ import {
|
|||||||
TemplateUiCommand,
|
TemplateUiCommand,
|
||||||
toast,
|
toast,
|
||||||
ui
|
ui
|
||||||
} from "@kksh/api/ui/worker"
|
} from "@kksh/api/ui/template"
|
||||||
|
|
||||||
class ExtensionTemplate extends TemplateUiCommand {
|
class ExtensionTemplate extends TemplateUiCommand {
|
||||||
async onFormSubmit(value: Record<string, any>): Promise<void> {
|
async onFormSubmit(value: Record<string, any>): Promise<void> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user