create-vidra-app 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from "react";
|
|
2
|
-
import { app, appWindow, clipboard, notifications, vidra } from "@vidra-dev/sdk";
|
|
1
|
+
import { type MouseEvent, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { app, appWindow, browser, clipboard, notifications, vidra } from "@vidra-dev/sdk";
|
|
3
3
|
import type { WindowInfo, WindowSupport } from "@vidra-dev/sdk";
|
|
4
4
|
|
|
5
5
|
const describeWindow = (windowInfo: WindowInfo): string => {
|
|
@@ -172,6 +172,18 @@ const App = () => {
|
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
+
const handleOpenVidraSite = async (
|
|
176
|
+
event: MouseEvent<HTMLAnchorElement>,
|
|
177
|
+
) => {
|
|
178
|
+
// Open in the user's default browser instead of navigating the webview.
|
|
179
|
+
event.preventDefault();
|
|
180
|
+
try {
|
|
181
|
+
await browser.open({ url: "https://vidra.build", mode: "external" });
|
|
182
|
+
} catch (error: unknown) {
|
|
183
|
+
setInfo(`Error: ${formatError(error)}`);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
175
187
|
const showsAdvancedWindowActions =
|
|
176
188
|
!!windowSupport &&
|
|
177
189
|
(windowSupport.center ||
|
|
@@ -254,9 +266,10 @@ const App = () => {
|
|
|
254
266
|
<footer className="footer">
|
|
255
267
|
Built with{" "}
|
|
256
268
|
<a
|
|
257
|
-
href="https://
|
|
269
|
+
href="https://vidra.dev"
|
|
258
270
|
target="_blank"
|
|
259
271
|
rel="noreferrer"
|
|
272
|
+
onClick={handleOpenVidraSite}
|
|
260
273
|
>
|
|
261
274
|
Vidra
|
|
262
275
|
</a>
|