Skip to content

Commit

Permalink
Merge pull request #37 from AppleBlox/dev
Browse files Browse the repository at this point in the history
Fix update popup and DiscordRPC on x64 versions of the app
  • Loading branch information
OrigamingWasTaken authored Oct 28, 2024
2 parents e4214a1 + d7e83e6 commit 2d579b5
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 30 deletions.
Binary file modified bun.lockb
Binary file not shown.
15 changes: 0 additions & 15 deletions frontend/src/windows/main/components/Link.svelte

This file was deleted.

17 changes: 6 additions & 11 deletions frontend/src/windows/main/components/Updater.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
import { Button } from '$lib/components/ui/button/index.js';
import { os } from '@neutralinojs/lib';
import compare from 'semver-compare';
import SvelteMarkdown from 'svelte-markdown';
import { toast } from 'svelte-sonner';
import { version } from '../../../../../package.json';
import { shell } from '../ts/tools/shell';
import { curlGet } from '../ts/utils';
import Link from './Link.svelte';
import { loadSettings, saveSettings } from './settings';
import MarkdownViewer from './markdown-viewer.svelte';
let showUpdatePopup = false;
let updateVersion = version;
Expand Down Expand Up @@ -60,16 +59,12 @@
}
</script>

<AlertDialog.Root bind:open={showUpdatePopup}>
<AlertDialog.Content>
<AlertDialog.Root bind:open={showUpdatePopup} closeOnOutsideClick={true} closeOnEscape={true}>
<AlertDialog.Content class="max-h-[90vh] max-w-[90vw] overflow-scroll">
<AlertDialog.Header>
<AlertDialog.Title>A new release is available (v{updateVersion})</AlertDialog.Title>
<AlertDialog.Description>
<SvelteMarkdown
source={body.replace(/(\n\s*\n)+/g, '<br><br>')}
options={{ gfm: true, breaks: true }}
renderers={{ link: Link }}
/>
<AlertDialog.Description class="text-foreground mt-0">
<p class="text-card-foreground mb-3">A new release is available (v{updateVersion})</p>
<MarkdownViewer content={body}/>
</AlertDialog.Description>
</AlertDialog.Header>
<AlertDialog.Footer>
Expand Down
39 changes: 39 additions & 0 deletions frontend/src/windows/main/components/markdown-viewer.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<script lang="ts">
import { marked } from 'marked';
import DOMPurify from 'dompurify';
import { os } from '@neutralinojs/lib';
import { cn } from '$lib/utils';
export let content: string = '';
let className: string = '';
export { className as class };
function handleLinkClick(e: MouseEvent) {
const target = e.target as HTMLElement;
if (target.tagName === 'A') {
e.preventDefault();
e.stopImmediatePropagation()
const href = target.getAttribute('href');
if (href) {
os.open(href);
}
}
}
$: parsedContent = marked.parse(content, { async: false }) as string;
$: sanitizedHtml = DOMPurify.sanitize(parsedContent);
</script>

<article
class={cn('markdown-content prose dark:prose-invert max-w-none prose-headings:text-primary prose-a:text-secondary', className)}
on:click={handleLinkClick}
aria-hidden="true"
>
{@html sanitizedHtml}
</article>

<style lang="postcss">
:global(.markdown-content blockquote) {
@apply border-l-4 border-primary pl-4;
}
</style>
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "appleblox",
"version": "0.8.0",
"version": "0.8.1",
"description": "Lightweight and fast Roblox launcher for MacOS",
"main": "frontend/src/windows/main/main.ts",
"scripts": {
Expand All @@ -25,6 +25,7 @@
"@neutralinojs/neu": "^10.1.0",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@tsconfig/svelte": "^5.0.2",
"@types/dompurify": "^3.0.5",
"@types/path-browserify": "^1.0.2",
"@types/semver-compare": "^1.0.3",
"@types/signale": "^1.4.7",
Expand All @@ -48,17 +49,19 @@
},
"dependencies": {
"@neutralinojs/lib": "^5.1.0",
"@tailwindcss/typography": "^0.5.15",
"@types/bun": "^1.1.9",
"bits-ui": "^0.21.16",
"clsx": "^2.1.1",
"cmdk-sv": "^0.0.18",
"dompurify": "^3.1.7",
"hotkeys-js": "^3.13.7",
"json-beautify": "^1.1.1",
"lucide-svelte": "^0.453.0",
"marked": "^14.1.3",
"mode-watcher": "^0.3.1",
"path-browserify": "^1.0.1",
"semver-compare": "^1.0.0",
"svelte-markdown": "^0.4.1",
"svelte-sonner": "^0.3.21",
"tailwind-merge": "^2.5.2",
"tailwind-variants": "^0.2.1"
Expand All @@ -68,7 +71,6 @@
"core-js",
"es5-ext",
"esbuild",
"svelte-preprocess",
"utf-8-validate"
"svelte-preprocess"
]
}
3 changes: 3 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const config = {
darkMode: ['class'],
content: ['./frontend/src/**/*.{html,js,svelte,ts}'],
safelist: ['dark'],
plugins: [
require('@tailwindcss/typography'),
],
theme: {
container: {
center: true,
Expand Down

0 comments on commit 2d579b5

Please sign in to comment.