diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 000000000..1c270ce34 Binary files /dev/null and b/bun.lockb differ diff --git a/packages/bruno-app/jsconfig.json b/packages/bruno-app/jsconfig.json index 9318203ce..867626852 100644 --- a/packages/bruno-app/jsconfig.json +++ b/packages/bruno-app/jsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "jsx": "react", "target": "es2017", "allowSyntheticDefaultImports": false, "baseUrl": "./", diff --git a/packages/bruno-app/src/components/Documentation/index.js b/packages/bruno-app/src/components/Documentation/index.js index 7b8b89425..809465034 100644 --- a/packages/bruno-app/src/components/Documentation/index.js +++ b/packages/bruno-app/src/components/Documentation/index.js @@ -1,7 +1,7 @@ import 'github-markdown-css/github-markdown.css'; import get from 'lodash/get'; import { updateRequestDocs } from 'providers/ReduxStore/slices/collections'; -import { useTheme } from 'providers/Theme/index'; +import { useTheme } from 'providers/Theme'; import { useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { saveRequest } from 'providers/ReduxStore/slices/collections/actions'; diff --git a/packages/bruno-app/src/components/MarkDown/index.js b/packages/bruno-app/src/components/MarkDown/index.jsx similarity index 77% rename from packages/bruno-app/src/components/MarkDown/index.js rename to packages/bruno-app/src/components/MarkDown/index.jsx index 1bf44483a..80f28cacf 100644 --- a/packages/bruno-app/src/components/MarkDown/index.js +++ b/packages/bruno-app/src/components/MarkDown/index.jsx @@ -1,19 +1,13 @@ import MarkdownIt from 'markdown-it'; import StyledWrapper from './StyledWrapper'; +import * as React from 'react'; const md = new MarkdownIt(); const Markdown = ({ onDoubleClick, content }) => { const handleOnDoubleClick = (event) => { - switch (event.detail) { - case 2: { - onDoubleClick(); - break; - } - case 1: - default: { - break; - } + if (event?.detail === 2) { + onDoubleClick(); } }; const htmlFromMarkdown = md.render(content || ''); diff --git a/packages/bruno-electron/src/index.js b/packages/bruno-electron/src/index.js index 92f281ed1..90df09ff8 100644 --- a/packages/bruno-electron/src/index.js +++ b/packages/bruno-electron/src/index.js @@ -98,9 +98,16 @@ app.on('ready', async () => { mainWindow.on('maximize', () => saveMaximized(true)); mainWindow.on('unmaximize', () => saveMaximized(false)); - mainWindow.webContents.on('new-window', function (e, url) { - e.preventDefault(); - require('electron').shell.openExternal(url); + mainWindow.webContents.on('will-redirect', (event, url) => { + event.preventDefault(); + if (/^(http:\/\/|https:\/\/)/.test(url)) { + require('electron').shell.openExternal(url); + } + }); + + mainWindow.webContents.setWindowOpenHandler((details) => { + require('electron').shell.openExternal(details.url); + return { action: 'allow' }; }); // register all ipc handlers