Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Polleps committed Oct 24, 2024
1 parent b927d56 commit 478360f
Show file tree
Hide file tree
Showing 16 changed files with 4,557 additions and 5,840 deletions.
2 changes: 1 addition & 1 deletion browser/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"prettier": "3.0.3"
},
"devDependencies": {
"typescript": "^5.4.5"
"typescript": "^5.6.3"
},
"description": "",
"license": "MIT",
Expand Down
9 changes: 6 additions & 3 deletions browser/cli/src/commands/ontologies.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/* eslint-disable no-console */
import * as fs from 'fs';
import chalk from 'chalk';
import * as prettier from 'prettier';
import {
resolveConfig as prettierResolveConfig,
format as prettierFormat,
} from 'prettier';
import * as path from 'path';
import { generateOntology } from '../generateOntology.js';
import { atomicConfig } from '../config.js';
Expand Down Expand Up @@ -75,10 +78,10 @@ const write = async ({
);

let formatted = content;
const prettierConfig = await prettier.resolveConfig(filePath);
const prettierConfig = await prettierResolveConfig(filePath);

if (prettierConfig) {
formatted = await prettier.format(content, {
formatted = await prettierFormat(content, {
...prettierConfig,
parser: 'typescript',
});
Expand Down
4 changes: 2 additions & 2 deletions browser/create-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"prettier": "3.0.3"
},
"devDependencies": {
"@types/node": "^20.11.5",
"typescript": "^5.4.5"
"@types/node": "^20.17.0",
"typescript": "^5.6.3"
},
"description": "Generate templates using Atomic Data",
"license": "MIT",
Expand Down
32 changes: 16 additions & 16 deletions browser/create-template/templates/sveltekit-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
"update-ontologies": "ad-generate ontologies"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/adapter-node": "^5.2.2",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@sveltejs/adapter-auto": "^3.3.0",
"@sveltejs/adapter-node": "^5.2.8",
"@sveltejs/kit": "^2.7.2",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@tomic/cli": "^0.39.0",
"@types/eslint": "^9.6.0",
"eslint": "^9.0.0",
"@types/eslint": "^9.6.1",
"eslint": "^9.13.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"svelte": "^4.2.7",
"svelte-check": "^3.6.0",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0",
"vite": "^5.0.3",
"vitest": "^2.0.0"
"eslint-plugin-svelte": "^2.46.0",
"globals": "^15.11.0",
"prettier": "^3.3.3",
"prettier-plugin-svelte": "^3.2.7",
"svelte": "^4.2.19",
"svelte-check": "^3.8.6",
"typescript": "^5.6.3",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10",
"vitest": "^2.1.3"
},
"type": "module",
"dependencies": {
Expand Down
89 changes: 44 additions & 45 deletions browser/data-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,74 +5,73 @@
"name": "Joep Meindertsma"
},
"dependencies": {
"@bugsnag/core": "^7.16.1",
"@bugsnag/js": "^7.16.5",
"@bugsnag/plugin-react": "^7.16.5",
"@dagrejs/dagre": "^1.0.2",
"@bugsnag/core": "^7.25.0",
"@bugsnag/js": "^7.25.0",
"@bugsnag/plugin-react": "^7.25.0",
"@dagrejs/dagre": "^1.1.4",
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@emoji-mart/react": "^1.1.1",
"@emotion/is-prop-valid": "^1.2.1",
"@emotion/is-prop-valid": "^1.3.1",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-scroll-area": "^1.0.1",
"@radix-ui/react-tabs": "^1.0.4",
"@tiptap/extension-image": "^2.4.0",
"@tiptap/extension-link": "^2.3.2",
"@tiptap/extension-placeholder": "^2.4.0",
"@tiptap/extension-typography": "^2.4.0",
"@tiptap/pm": "^2.3.0",
"@tiptap/react": "^2.3.0",
"@tiptap/starter-kit": "^2.3.0",
"@tiptap/suggestion": "^2.4.0",
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-tabs": "^1.1.1",
"@tiptap/extension-image": "^2.9.1",
"@tiptap/extension-link": "^2.9.1",
"@tiptap/extension-placeholder": "^2.9.1",
"@tiptap/extension-typography": "^2.9.1",
"@tiptap/pm": "^2.9.1",
"@tiptap/react": "^2.9.1",
"@tiptap/starter-kit": "^2.9.1",
"@tiptap/suggestion": "^2.9.1",
"@tomic/react": "workspace:*",
"emoji-mart": "^5.6.0",
"polished": "^4.1.0",
"polished": "^4.3.1",
"prismjs": "^1.29.0",
"query-string": "^7.0.0",
"query-string": "^7.1.3",
"quick-score": "^0.2.0",
"react": "^18.2.0",
"react-colorful": "^5.1.1",
"react-dom": "^18.2.0",
"react-dropzone": "^11.4.2",
"react": "^18.3.1",
"react-colorful": "^5.6.1",
"react-dom": "^18.3.1",
"react-dropzone": "^11.7.1",
"react-helmet-async": "^1.3.0",
"react-hot-toast": "^2.4.0",
"react-hotkeys-hook": "^3.1.0",
"react-icons": "^4.9.0",
"react-intersection-observer": "^9.4.1",
"react-is": "^18",
"react-markdown": "^8.0.3",
"react-pdf": "^8.0.2",
"react-router": "^6.9.0",
"react-router-dom": "^6.9.0",
"react-virtualized-auto-sizer": "^1.0.7",
"react-window": "^1.8.9",
"reactflow": "^11.8.3",
"react-hot-toast": "^2.4.1",
"react-hotkeys-hook": "^3.4.7",
"react-icons": "^4.12.0",
"react-intersection-observer": "^9.13.1",
"react-is": "^18.3.1",
"react-markdown": "^8.0.7",
"react-pdf": "^9.1.1",
"react-router": "^6.27.0",
"react-router-dom": "^6.27.0",
"react-virtualized-auto-sizer": "^1.0.24",
"react-window": "^1.8.10",
"reactflow": "^11.11.4",
"remark-gfm": "^3.0.1",
"styled-components": "^6.0.7",
"styled-components": "^6.1.13",
"stylis": "4.3.0",
"tippy.js": "^6.3.7",
"tiptap-markdown": "^0.8.10"
},
"devDependencies": {
"@swc/plugin-styled-components": "^2.0.12",
"@types/prismjs": "^1.26.4",
"@types/react": "^18.2.34",
"@types/react-dom": "^18.2.14",
"@types/prismjs": "^1.26.5",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-pdf": "^7.0.0",
"@types/react-router-dom": "^5.3.3",
"@types/react-pdf": "^6.2.0",
"@types/react-window": "^1.8.7",
"@vitejs/plugin-react-swc": "^3.5.0",
"csstype": "^3.1.0",
"@types/react-window": "^1.8.8",
"@vitejs/plugin-react-swc": "^3.7.1",
"csstype": "^3.1.3",
"gh-pages": "^5.0.0",
"lint-staged": "^10.5.4",
"types-wm": "^1.1.0",
"typescript": "^5.4.5",
"vite": "^5.2.10",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vite-plugin-prismjs": "^0.0.11",
"vite-plugin-pwa": "^0.20.5",
"vite-plugin-webfont-dl": "^3.9.1",
"workbox-cli": "^6.4.1"
"vite-plugin-webfont-dl": "^3.9.5"
},
"type": "module",
"homepage": "https://atomicdata.dev/",
Expand Down
12 changes: 6 additions & 6 deletions browser/data-browser/src/chunks/MarkdownEditor/BubbleMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function BubbleMenu(): React.JSX.Element {
<NodeSelectMenu />
<ToggleButton
title='Toggle bold'
$active={!!editor.isActive('bold') ?? undefined}
$active={!!editor.isActive('bold')}
onClick={() => editor.chain().focus().toggleBold().run()}
disabled={!editor.can().chain().focus().toggleBold().run()}
type='button'
Expand All @@ -42,7 +42,7 @@ export function BubbleMenu(): React.JSX.Element {
</ToggleButton>
<ToggleButton
title='Toggle italic'
$active={!!editor.isActive('italic') ?? undefined}
$active={!!editor.isActive('italic')}
onClick={() => editor.chain().focus().toggleItalic().run()}
disabled={!editor.can().chain().focus().toggleItalic().run()}
type='button'
Expand All @@ -51,7 +51,7 @@ export function BubbleMenu(): React.JSX.Element {
</ToggleButton>
<ToggleButton
title='Toggle strikethrough'
$active={!!editor.isActive('strike') ?? undefined}
$active={!!editor.isActive('strike')}
onClick={() => editor.chain().focus().toggleStrike().run()}
disabled={!editor.can().chain().focus().toggleStrike().run()}
type='button'
Expand All @@ -60,7 +60,7 @@ export function BubbleMenu(): React.JSX.Element {
</ToggleButton>
<ToggleButton
title='Toggle blockquote'
$active={!!editor.isActive('blockquote') ?? undefined}
$active={!!editor.isActive('blockquote')}
onClick={() => editor.chain().focus().toggleBlockquote().run()}
disabled={!editor.can().chain().focus().toggleBlockquote().run()}
type='button'
Expand All @@ -69,7 +69,7 @@ export function BubbleMenu(): React.JSX.Element {
</ToggleButton>
<ToggleButton
title='Toggle inline code'
$active={!!editor.isActive('code') ?? undefined}
$active={!!editor.isActive('code')}
onClick={() => editor.chain().focus().toggleCode().run()}
disabled={!editor.can().chain().focus().toggleCode().run()}
type='button'
Expand All @@ -83,7 +83,7 @@ export function BubbleMenu(): React.JSX.Element {
Trigger={
<ToggleButton
as={RadixPopover.Trigger}
$active={!!editor.isActive('link') ?? undefined}
$active={!!editor.isActive('link')}
disabled={!editor.can().chain().focus().toggleCode().run()}
type='button'
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type PartialImageNodeProps = {

export const ExtendedImage = Image.extend({
addNodeView() {
// @ts-ignore. Weird type issue probably due to incorrect tiptap types.
return ReactNodeViewRenderer(MarkdownEditorImage);
},
});
Expand Down
35 changes: 31 additions & 4 deletions browser/data-browser/src/hooks/useFile.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
import { Resource, server, useNumber, useString } from '@tomic/react';
import { useCallback } from 'react';

export function useFileInfo(resource: Resource) {
type FileInfo =
| {
loading: true;
downloadUrl: undefined;
downloadFile: () => void;
mimeType: undefined;
bytes: undefined;
}
| {
loading: false;
downloadUrl: string;
downloadFile: () => void;
mimeType: string;
bytes: number;
};

export function useFileInfo(resource: Resource): FileInfo {
const [downloadUrl] = useString(resource, server.properties.downloadUrl);
const [mimeType] = useString(resource, server.properties.mimetype);
const [bytes] = useNumber(resource, server.properties.filesize);
Expand All @@ -17,10 +33,21 @@ export function useFileInfo(resource: Resource) {
throw new Error('File resource is missing properties');
}

if (resource.loading) {
return {
loading: true,
downloadUrl: undefined,
downloadFile,
mimeType: undefined,
bytes: undefined,
};
}

return {
loading: false,
downloadFile,
downloadUrl,
bytes,
mimeType,
downloadUrl: downloadUrl!,
bytes: bytes!,
mimeType: mimeType!,
};
}
12 changes: 7 additions & 5 deletions browser/data-browser/src/views/File/FilePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ interface FilePreviewProps {
}

export function FilePreview({ resource, hideTypes }: FilePreviewProps) {
const { downloadUrl, mimeType, bytes } = useFileInfo(resource);
const { downloadUrl, mimeType, bytes, loading } = useFileInfo(resource);
const [ignoreSizeLimit, setIgnoreSizeLimit] = useState(false);
const fileSizeLimit = useFilePreviewSizeLimit();
const shouldShowType = buildShouldShowType(mimeType, hideTypes);
const shouldShowType = buildShouldShowType(mimeType ?? '', hideTypes);

if (loading) {
return <NoPreview>Loading...</NoPreview>;
}

if (bytes > fileSizeLimit && !ignoreSizeLimit) {
return (
Expand All @@ -29,9 +33,7 @@ export function FilePreview({ resource, hideTypes }: FilePreviewProps) {
}

if (shouldShowType('image/')) {
return (
<StyledImageViewer src={downloadUrl} subject={resource.getSubject()} />
);
return <StyledImageViewer src={downloadUrl} subject={resource.subject} />;
}

if (shouldShowType('video/')) {
Expand Down
6 changes: 5 additions & 1 deletion browser/data-browser/src/views/File/FilePreviewThumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ export function FilePreviewThumbnail(
function FilePreviewThumbnailInner({
resource,
}: FilePreviewThumbnailProps): JSX.Element {
const { downloadUrl, mimeType, bytes } = useFileInfo(resource);
const { downloadUrl, mimeType, bytes, loading } = useFileInfo(resource);
const previewSizeLimit = useFilePreviewSizeLimit();
const transitionStyles = useFileImageTransitionStyles(resource.subject);

if (loading) {
return <TextWrapper>Loading...</TextWrapper>;
}

if (bytes >= previewSizeLimit) {
return <TextWrapper>To large for preview</TextWrapper>;
}
Expand Down
2 changes: 1 addition & 1 deletion browser/e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"url": "https://github.com/atomicdata-dev/atomic-server/"
},
"devDependencies": {
"@playwright/test": "^1.43.1"
"@playwright/test": "^1.48.1"
},
"scripts": {
"playwright-install": "playwright install chromium",
Expand Down
14 changes: 7 additions & 7 deletions browser/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
"author": "Joep Meindertsma",
"dependencies": {
"@noble/ed25519": "1.6.0",
"@noble/hashes": "^0.5.7",
"@noble/hashes": "^0.5.9",
"base64-arraybuffer": "^1.0.2",
"fast-json-stable-stringify": "^2.1.0",
"ulidx": "^2.3.0"
"ulidx": "^2.4.1"
},
"description": "",
"devDependencies": {
"@tomic/cli": "workspace:*",
"@types/fast-json-stable-stringify": "^2.1.0",
"tslib": "^2.4.1",
"typescript": "^5.4.5",
"vite": "^5.2.10",
"vite-plugin-dts": "^3.9.0"
"@types/fast-json-stable-stringify": "^2.1.2",
"tslib": "^2.8.0",
"typescript": "^5.6.3",
"vite": "^5.4.10",
"vite-plugin-dts": "^3.9.1"
},
"files": [
"dist"
Expand Down
Loading

0 comments on commit 478360f

Please sign in to comment.