Compare commits

...

3 Commits

Author SHA1 Message Date
amk-dev
f862b4aaae fix: fix actions not triggered when sidebar is not open 2023-12-19 15:17:03 +05:30
Andrew Bastin
7374a35b41 fix: broken ui due to accidentally moved postcss config 2023-12-19 12:40:07 +05:30
Andrew Bastin
5ad8f6c2ce chore: move window.open to platform io to handle desktop app 2023-12-19 11:26:37 +05:30
9 changed files with 39 additions and 14 deletions

View File

@@ -1,11 +1,11 @@
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'
export {}
declare module '@vue/runtime-core' {
declare module 'vue' {
export interface GlobalComponents {
AppActionHandler: typeof import('./components/app/ActionHandler.vue')['default']
AppBanner: typeof import('./components/app/Banner.vue')['default']
@@ -210,5 +210,4 @@ declare module '@vue/runtime-core' {
WorkspaceCurrent: typeof import('./components/workspace/Current.vue')['default']
WorkspaceSelector: typeof import('./components/workspace/Selector.vue')['default']
}
}

View File

@@ -1,15 +1,16 @@
<template>
<Splitpanes
class="smart-splitter"
:rtl="SIDEBAR_ON_LEFT && mdAndLarger"
:class="{
'!flex-row-reverse': SIDEBAR_ON_LEFT && mdAndLarger,
'smart-splitter': SIDEBAR && hasSidebar,
'no-splitter': !(SIDEBAR && hasSidebar),
}"
:horizontal="!mdAndLarger"
@resize="setPaneEvent($event, 'vertical')"
>
<Pane
:size="PANE_MAIN_SIZE"
:size="SIDEBAR && hasSidebar ? PANE_MAIN_SIZE : 100"
min-size="65"
class="flex flex-col !overflow-auto"
>
@@ -36,9 +37,8 @@
</Splitpanes>
</Pane>
<Pane
v-if="SIDEBAR && hasSidebar"
:size="PANE_SIDEBAR_SIZE"
min-size="25"
:size="SIDEBAR && hasSidebar ? PANE_SIDEBAR_SIZE : 0"
:min-size="25"
class="flex flex-col !overflow-auto bg-primaryContrast"
>
<slot name="sidebar" />

View File

@@ -199,7 +199,7 @@ const GqlCollectionsGistExporter: ImporterOrExporter = {
exporter: "gist",
})
window.open(res.right, "_blank")
platform.io.openExternalLink(res.right)
}
},
}

View File

@@ -297,7 +297,7 @@ const HoppEnvironmentsGistExporter: ImporterOrExporter = {
platform: "rest",
})
window.open(res.right, "_blank")
platform.io.openExternalLink(res.right)
}
},
}

View File

@@ -81,4 +81,11 @@ export type IOPlatformDef = {
saveFileWithDialog: (
opts: SaveFileWithDialogOptions
) => Promise<SaveFileResponse>
/**
* Opens a link in the user's browser.
* The expected behaviour is for the browser to open a new tab/window (for example in desktop app) with the given URL.
* @param url The URL to open
*/
openExternalLink: (url: string) => Promise<void>
}

View File

@@ -34,4 +34,10 @@ export const browserIODef: IOPlatformDef = {
// Browsers provide no way for us to know the save went successfully.
return Promise.resolve({ type: "unknown" })
},
openExternalLink(url) {
window.open(url, "_blank")
// Browsers provide no way for us to know the open went successfully.
return Promise.resolve()
},
}

View File

@@ -14,6 +14,7 @@ import IconGitHub from "~icons/lucide/github"
import IconBook from "~icons/lucide/book"
import IconLifeBuoy from "~icons/lucide/life-buoy"
import IconZap from "~icons/lucide/zap"
import { platform } from "~/platform"
type Doc = {
text: string | string[]
@@ -113,7 +114,7 @@ export class GeneralSpotlightSearcherService extends StaticSpotlightSearcherServ
}
private openURL(url: string) {
window.open(url, "_blank")
platform.io.openExternalLink(url)
}
public onDocSelected(id: string): void {

View File

@@ -1,5 +1,6 @@
import { IOPlatformDef } from "@hoppscotch/common/platform/io"
import { save } from "@tauri-apps/api/dialog"
import { open } from "@tauri-apps/api/shell"
import { writeBinaryFile, writeTextFile } from "@tauri-apps/api/fs"
export const ioDef: IOPlatformDef = {
@@ -21,4 +22,7 @@ export const ioDef: IOPlatformDef = {
return { type: "saved", path }
},
openExternalLink(url) {
return open(url)
},
}

View File

@@ -0,0 +1,8 @@
const config = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
module.exports = config