Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ tauri-plugin-misc = { path = "plugins/misc" }
tauri-plugin-network = { path = "plugins/network" }
tauri-plugin-notification = { path = "plugins/notification" }
tauri-plugin-notify = { path = "plugins/notify" }
tauri-plugin-opener2 = { path = "plugins/opener2" }
tauri-plugin-overlay = { path = "plugins/overlay" }
tauri-plugin-path2 = { path = "plugins/path2" }
tauri-plugin-pdf = { path = "plugins/pdf" }
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@hypr/plugin-network": "workspace:*",
"@hypr/plugin-notification": "workspace:*",
"@hypr/plugin-notify": "workspace:*",
"@hypr/plugin-opener2": "workspace:*",
"@hypr/plugin-overlay": "workspace:*",
"@hypr/plugin-path2": "workspace:*",
"@hypr/plugin-pdf": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ tauri-plugin-network = { workspace = true }
tauri-plugin-notification = { workspace = true }
tauri-plugin-notify = { workspace = true }
tauri-plugin-opener = { workspace = true }
tauri-plugin-opener2 = { workspace = true }
tauri-plugin-os = { workspace = true }
tauri-plugin-overlay = { workspace = true }
tauri-plugin-path2 = { workspace = true }
Expand Down
30 changes: 1 addition & 29 deletions apps/desktop/src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,6 @@
"core:window:allow-set-position",
"core:window:allow-is-maximized",
"core:window:allow-toggle-maximize",
"opener:default",
{
"identifier": "opener:allow-open-url",
"allow": [
{
"url": "https://**"
},
{
"url": "mailto:*"
},
{
"url": "obsidian://**"
}
]
},
{
"identifier": "opener:allow-open-path",
"allow": [
{
"path": "$DATA/hyprnote/**/*"
},
{
"path": "$APPDATA/**/*"
},
{
"path": "$DOWNLOAD/**/*"
}
]
},
"apple-calendar:default",
"apple-contact:default",
"audio-priority:default",
Expand Down Expand Up @@ -98,6 +69,7 @@
"fs-sync:default",
"fs2:default",
"os:default",
"opener2:default",
"detect:default",
"permissions:default",
"settings:default",
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ pub async fn main() {
builder = builder
.plugin(tauri_plugin_cli2::init())
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_opener2::init())
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_analytics::init())
.plugin(tauri_plugin_importer::init())
Expand Down
7 changes: 5 additions & 2 deletions apps/desktop/src/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
import { getCurrentWindow } from "@tauri-apps/api/window";
import { onOpenUrl } from "@tauri-apps/plugin-deep-link";
import { fetch as tauriFetch } from "@tauri-apps/plugin-http";
import { openUrl } from "@tauri-apps/plugin-opener";
import {
createContext,
useCallback,
Expand All @@ -23,6 +22,7 @@ import {
import { commands as analyticsCommands } from "@hypr/plugin-analytics";
import { commands } from "@hypr/plugin-auth";
import { commands as miscCommands } from "@hypr/plugin-misc";
import { commands as openerCommands } from "@hypr/plugin-opener2";

import { env } from "./env";
import { getScheme } from "./utils";
Expand Down Expand Up @@ -268,7 +268,10 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
const signIn = useCallback(async () => {
const base = env.VITE_APP_URL ?? "http://localhost:3000";
const scheme = await getScheme();
await openUrl(`${base}/auth?flow=desktop&scheme=${scheme}`);
await openerCommands.openUrl(
`${base}/auth?flow=desktop&scheme=${scheme}`,
null,
);
}, []);

const signOut = useCallback(async () => {
Expand Down
6 changes: 4 additions & 2 deletions apps/desktop/src/billing.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { openUrl } from "@tauri-apps/plugin-opener";
import { jwtDecode } from "jwt-decode";
import {
createContext,
Expand All @@ -8,6 +7,8 @@ import {
useMemo,
} from "react";

import { commands as openerCommands } from "@hypr/plugin-opener2";

import { useAuth } from "./auth";
import { env } from "./env";
import { getScheme } from "./utils";
Expand Down Expand Up @@ -48,8 +49,9 @@ export function BillingProvider({ children }: { children: ReactNode }) {

const upgradeToPro = useCallback(async () => {
const scheme = await getScheme();
void openUrl(
void openerCommands.openUrl(
`${env.VITE_APP_URL}/app/checkout?period=monthly&scheme=${scheme}`,
null,
);
}, []);

Expand Down
6 changes: 4 additions & 2 deletions apps/desktop/src/components/main/body/changelog/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { openUrl } from "@tauri-apps/plugin-opener";
import { format } from "date-fns";
import { CalendarIcon, ExternalLinkIcon, SparklesIcon } from "lucide-react";
import { useEffect, useRef, useState } from "react";

import { commands as openerCommands } from "@hypr/plugin-opener2";
import NoteEditor from "@hypr/tiptap/editor";
import { md2json } from "@hypr/tiptap/shared";
import {
Expand Down Expand Up @@ -193,7 +193,9 @@ function ChangelogHeader({
size="sm"
variant="ghost"
className="gap-1.5 text-neutral-600 hover:text-black"
onClick={() => openUrl("https://hyprnote.com/changelog")}
onClick={() =>
openerCommands.openUrl("https://hyprnote.com/changelog", null)
}
>
<ExternalLinkIcon size={14} className="-mt-0.5" />
<span>See all</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Icon } from "@iconify-icon/react";
import { openUrl } from "@tauri-apps/plugin-opener";
import { Building2, Mail } from "lucide-react";

import { commands as openerCommands } from "@hypr/plugin-opener2";
import { Button } from "@hypr/ui/components/ui/button";
import { Input } from "@hypr/ui/components/ui/input";

Expand Down Expand Up @@ -102,7 +102,10 @@ export function OrganizationDetailsColumn({
size="icon"
onClick={(e) => {
e.stopPropagation();
void openUrl(`mailto:${human.email}`);
void openerCommands.openUrl(
`mailto:${human.email}`,
null,
);
}}
title="Send email"
>
Expand All @@ -121,7 +124,7 @@ export function OrganizationDetailsColumn({
const href = /^https?:\/\//i.test(v)
? v
: `https://www.linkedin.com/in/${v.replace(/^@/, "")}`;
void openUrl(href);
void openerCommands.openUrl(href, null);
}}
title="View LinkedIn profile"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { openUrl } from "@tauri-apps/plugin-opener";
import { differenceInDays, format, startOfDay } from "date-fns";
import { CalendarIcon, MapPinIcon, VideoIcon } from "lucide-react";
import { forwardRef, useState } from "react";

import { commands as openerCommands } from "@hypr/plugin-opener2";
import { Button } from "@hypr/ui/components/ui/button";
import {
Popover,
Expand Down Expand Up @@ -102,7 +102,7 @@ function EventDisplay({
}) {
const handleJoinMeeting = () => {
if (event.meetingLink) {
void openUrl(event.meetingLink);
void openerCommands.openUrl(event.meetingLink, null);
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useMutation } from "@tanstack/react-query";
import { save } from "@tauri-apps/plugin-dialog";
import { openPath } from "@tauri-apps/plugin-opener";
import { FileTextIcon, Loader2Icon } from "lucide-react";
import { useMemo } from "react";

import { commands as analyticsCommands } from "@hypr/plugin-analytics";
import { commands as openerCommands } from "@hypr/plugin-opener2";
import { commands as pdfCommands, type TranscriptItem } from "@hypr/plugin-pdf";
import { json2md } from "@hypr/tiptap/shared";
import { DropdownMenuItem } from "@hypr/ui/components/ui/dropdown-menu";
Expand Down Expand Up @@ -185,7 +185,7 @@ export function ExportPDF({
currentView.type === "enhanced" && !!enhancedNoteContent,
has_memo: currentView.type === "raw" && !!rawMd,
});
void openPath(path);
void openerCommands.openPath(path, null);
}
},
onError: console.error,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useMutation } from "@tanstack/react-query";
import { openPath } from "@tauri-apps/plugin-opener";
import { FileTextIcon, Loader2Icon } from "lucide-react";
import { useMemo } from "react";

Expand All @@ -8,6 +7,7 @@ import {
commands as listener2Commands,
type VttWord,
} from "@hypr/plugin-listener2";
import { commands as openerCommands } from "@hypr/plugin-opener2";
import { DropdownMenuItem } from "@hypr/ui/components/ui/dropdown-menu";

import * as main from "../../../../../../store/tinybase/store/main";
Expand Down Expand Up @@ -65,7 +65,7 @@ export function ExportTranscript({ sessionId }: { sessionId: string }) {
format: "vtt",
word_count: words.length,
});
openPath(path);
openerCommands.openPath(path, null);
},
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Icon } from "@iconify-icon/react";
import { useMutation } from "@tanstack/react-query";
import { openPath } from "@tauri-apps/plugin-opener";
import { FolderIcon, Link2Icon, Loader2Icon } from "lucide-react";

import { commands as fsSyncCommands } from "@hypr/plugin-fs-sync";
import { commands as openerCommands } from "@hypr/plugin-opener2";
import {
DropdownMenuItem,
DropdownMenuSub,
Expand Down Expand Up @@ -62,7 +62,7 @@ export function ShowInFinder({ sessionId }: { sessionId: string }) {
if (result.status === "error") {
throw new Error(result.error);
}
await openPath(result.data);
await openerCommands.openPath(result.data, null);
},
});

Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/components/main/sidebar/timeline/item.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { revealItemInDir } from "@tauri-apps/plugin-opener";
import { memo, useCallback, useMemo } from "react";

import { commands as fsSyncCommands } from "@hypr/plugin-fs-sync";
import { commands as openerCommands } from "@hypr/plugin-opener2";
import { Spinner } from "@hypr/ui/components/ui/spinner";
import {
Tooltip,
Expand Down Expand Up @@ -252,7 +252,7 @@ const SessionItem = memo(
await save();
const result = await fsSyncCommands.sessionDir(sessionId);
if (result.status === "ok") {
await revealItemInDir(result.data);
await openerCommands.revealItemInDir(result.data);
}
}, [sessionId]);

Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/components/settings/ai/stt/configure.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Icon } from "@iconify-icon/react";
import { useQuery } from "@tanstack/react-query";
import { openPath } from "@tauri-apps/plugin-opener";
import { arch, platform } from "@tauri-apps/plugin-os";
import { useCallback } from "react";

import {
commands as localSttCommands,
type SupportedSttModel,
} from "@hypr/plugin-local-stt";
import { commands as openerCommands } from "@hypr/plugin-opener2";
import {
Accordion,
AccordionContent,
Expand Down Expand Up @@ -398,7 +398,7 @@ function HyprProviderLocalRow({
const handleOpen = () => {
void localSttCommands.modelsDir().then((result) => {
if (result.status === "ok") {
void openPath(result.data);
void openerCommands.openPath(result.data, null);
}
});
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { openUrl } from "@tauri-apps/plugin-opener";

import { commands as openerCommands } from "@hypr/plugin-opener2";
import {
AccordionContent,
AccordionItem,
Expand Down Expand Up @@ -64,7 +63,7 @@ export function AppleCalendarProviderCard() {
contacts permissions.
</StyledStreamdown>
<button
onClick={() => openUrl(config.docsPath)}
onClick={() => openerCommands.openUrl(config.docsPath, null)}
className="text-xs text-neutral-400 hover:text-neutral-600 transition-colors"
>
Docs ↗
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/components/settings/data/source-item.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { revealItemInDir } from "@tauri-apps/plugin-opener";
import { CheckIcon, Loader2Icon } from "lucide-react";

import { type ImportSourceInfo } from "@hypr/plugin-importer";
import { commands as openerCommands } from "@hypr/plugin-opener2";
import { Button } from "@hypr/ui/components/ui/button";

export function SourceItem({
Expand All @@ -25,7 +25,7 @@ export function SourceItem({
Import data from `
<button
type="button"
onClick={() => revealItemInDir(source.revealPath)}
onClick={() => openerCommands.revealItemInDir(source.revealPath)}
className="underline hover:text-neutral-900 cursor-pointer"
>
{source.path}
Expand Down
Loading
Loading