feat(packages): add UI support for gestures and hotkeys (#1388)

Co-authored-by: Rahim <rahim.alwer@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sam Potts
2026-05-05 10:34:12 +10:00
committed by GitHub
co-authored by Rahim Claude Opus 4.6
parent 6c81f2d190
commit 0620814a67
187 changed files with 5665 additions and 405 deletions
+44
View File
@@ -0,0 +1,44 @@
import { existsSync, readdirSync } from 'node:fs';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import type { Config, PluginConfig } from 'svgo';
const __dirname = dirname(fileURLToPath(import.meta.url));
export const ROOT = join(__dirname, '..');
export const ASSETS_DIR = join(ROOT, 'src/assets');
export const DIST_DIR = join(ROOT, 'dist');
export const PRESET_DEFAULT_OVERRIDES = {
convertColors: {
currentColor: /^black$/,
},
} as const;
export const REMOVE_ATTRS_PLUGIN: PluginConfig = {
name: 'removeAttrs',
params: {
attrs: ['^clip-rule$', '^fill-rule$'],
},
};
export function createSvgoConfig(plugins: PluginConfig[], options?: Omit<Config, 'plugins'>): Config {
return { multipass: true, ...options, plugins };
}
export function replaceColors(svg: string): string {
return svg.replaceAll('fill="black"', 'fill="currentColor"').replaceAll('stroke="black"', 'stroke="currentColor"');
}
export function getIconSets(): string[] {
if (!existsSync(ASSETS_DIR)) {
console.error(`Assets directory not found: ${ASSETS_DIR}`);
process.exit(1);
}
return readdirSync(ASSETS_DIR).filter((item) => !item.startsWith('.') && item !== 'index');
}
export function getSvgFiles(setName: string): string[] {
return readdirSync(join(ASSETS_DIR, setName)).filter((f) => f.endsWith('.svg'));
}