Compare commits

...
Author SHA1 Message Date
James Brunton f1f8c52b00 Redesign tsconfig.json files 2025-10-30 16:59:44 +00:00
James BruntonandGitHub 8060934ee9 Add linting to ensure correct imports style is used (#4759)
# Description of Changes
Add linting to ensure correct imports style is used.

I've disabled the linting for two imports which use relative paths
because the files they're importing are siblings to core and
proprietary. They could probs be imported by `@app/../assets/xxx` but it
seems silly. The other thing we could do is add an explicit `@assets`
path alias or something, but it seemed more complex than just disabling
the lint for those two imports at this stage. We could always do it in
the future if we want to import stuff up there a lot in the future.
2025-10-29 11:58:04 +00:00
James BruntonandGitHub ef177be918 Fix issues with fullscreen tools on Safari (#4757)
# Description of Changes
Fix issues with fullscreen tools not rendering and throwing SVG errors
in the console on Safari.
2025-10-29 09:56:16 +00:00
10 changed files with 39 additions and 17 deletions
+9
View File
@@ -27,6 +27,15 @@ export default defineConfig(
tseslint.configs.recommended,
{
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
".*", // Disallow any relative imports (they should be '@app/x/y/z' or similar)
"src/*", // Disallow any absolute imports (they should be '@app/x/y/z' or similar)
],
},
],
'@typescript-eslint/no-empty-object-type': [
'error',
{
+3 -3
View File
@@ -62,9 +62,9 @@
"lint": "eslint --max-warnings=0",
"build": "vite build",
"preview": "vite preview",
"typecheck": "tsc --noEmit",
"typecheck:core": "tsc --noEmit --project tsconfig.core.json",
"typecheck:proprietary": "tsc --noEmit --project tsconfig.proprietary.json",
"typecheck": "npm run typecheck:proprietary",
"typecheck:core": "tsc --noEmit --project src/core/tsconfig.json",
"typecheck:proprietary": "tsc --noEmit --project src/proprietary/tsconfig.json",
"typecheck:all": "npm run typecheck:core && npm run typecheck:proprietary",
"check": "npm run typecheck && npm run lint && npm run test:run",
"generate-licenses": "node scripts/generate-licenses.js",
@@ -1,6 +1,6 @@
import React from 'react';
import { addCollection, Icon } from '@iconify/react';
import iconSet from '../../../assets/material-symbols-icons.json';
import iconSet from '../../../assets/material-symbols-icons.json'; // eslint-disable-line no-restricted-imports -- Outside app paths
// Load icons synchronously at import time - guaranteed to be ready on first render
let iconsLoaded = false;
@@ -29,7 +29,7 @@ interface LocalIconProps {
* LocalIcon component that uses our locally bundled Material Symbols icons
* instead of loading from CDN
*/
export const LocalIcon: React.FC<LocalIconProps> = ({ icon, ...props }) => {
export const LocalIcon: React.FC<LocalIconProps> = ({ icon, width, height, style, ...props }) => {
// Convert our icon naming convention to the local collection format
const iconName = icon.startsWith('material-symbols:')
? icon
@@ -45,8 +45,20 @@ export const LocalIcon: React.FC<LocalIconProps> = ({ icon, ...props }) => {
}
}
const iconStyle: React.CSSProperties = { ...style };
// Use width if provided, otherwise fall back to height
const size = width || height;
if (size && typeof size === 'string') {
// If it's a CSS unit string (like '1.5rem'), use it as fontSize
iconStyle.fontSize = size;
} else if (typeof size === 'number') {
// If it's a number, treat it as pixels
iconStyle.fontSize = `${size}px`;
}
// Always render the icon - Iconify will use local if available, CDN if not
return <Icon icon={iconName} {...props} />;
return <Icon icon={iconName} style={iconStyle} {...props} />;
};
export default LocalIcon;
@@ -187,7 +187,6 @@
border: 1px solid var(--fullscreen-border-subtle-65);
box-shadow: 0 14px 32px var(--fullscreen-shadow-group);
break-inside: avoid;
backdrop-filter: blur(10px);
}
.tool-panel__fullscreen-section-header {
@@ -230,7 +229,6 @@
border: 1px solid var(--fullscreen-border-subtle-70);
border-radius: 0.95rem;
background: var(--fullscreen-bg-item);
backdrop-filter: blur(6px);
cursor: pointer;
transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
width: 100%;
@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"paths": {
"@app/*": [
@@ -9,7 +9,7 @@
}
},
"exclude": [
"src/proprietary",
"../proprietary",
"node_modules"
]
}
+1 -1
View File
@@ -1,6 +1,6 @@
import '@mantine/core/styles.css';
import '@mantine/dates/styles.css';
import '../vite-env.d.ts';
import '../vite-env.d.ts'; // eslint-disable-line no-restricted-imports -- Outside app paths
import '@app/styles/index.css'; // Import global styles
import React from 'react';
import ReactDOM from 'react-dom/client';
@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"paths": {
"@app/*": [
@@ -9,5 +9,8 @@
"@proprietary/*": ["src/proprietary/*"],
"@core/*": ["src/core/*"]
}
}
},
"exclude": [
"node_modules"
]
}
+2 -2
View File
@@ -35,8 +35,8 @@
"src/proprietary/*",
"src/core/*"
],
"@core/*": ["src/core/*"],
"@proprietary/*": ["src/proprietary/*"]
"@proprietary/*": ["src/proprietary/*"],
"@core/*": ["src/core/*"]
},
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
+1 -1
View File
@@ -10,7 +10,7 @@ export default defineConfig({
react(),
tsconfigPaths({
projects: [
isProprietary ? './tsconfig.proprietary.json' : './tsconfig.core.json',
isProprietary ? './src/proprietary/tsconfig.json' : './src/core/tsconfig.json',
],
}),
],
+1 -1
View File
@@ -10,7 +10,7 @@ export default defineConfig({
react(),
tsconfigPaths({
projects: [
isProprietary ? './tsconfig.proprietary.json' : './tsconfig.core.json',
isProprietary ? './src/proprietary/tsconfig.json' : './src/core/tsconfig.json',
],
}),
],