Compare commits
3 Commits
2ddffe1b12
...
7f6c217d7e
Author | SHA1 | Date | |
---|---|---|---|
|
7f6c217d7e | ||
|
ccedaa62a6 | ||
|
128eeb24ac |
|
@ -42,7 +42,6 @@ export function ColorFunctionProvider({ children }: WasmProviderProps) {
|
||||||
try {
|
try {
|
||||||
await init();
|
await init();
|
||||||
setWasmInstance(funcs);
|
setWasmInstance(funcs);
|
||||||
console.debug('[Load WASM]', 'Loaded');
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('[Load WASM]', e);
|
console.error('[Load WASM]', e);
|
||||||
setError(e);
|
setError(e);
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { HSegmentedControl } from '../components/HSegmentedControl';
|
||||||
import { ScrollArea } from '../components/ScrollArea';
|
import { ScrollArea } from '../components/ScrollArea';
|
||||||
import { ColorDescription } from '../models';
|
import { ColorDescription } from '../models';
|
||||||
import { ColorCard } from '../page-components/cards-detail/ColorCard';
|
import { ColorCard } from '../page-components/cards-detail/ColorCard';
|
||||||
|
import { mapToObject } from '../utls';
|
||||||
import styles from './CardsDetail.module.css';
|
import styles from './CardsDetail.module.css';
|
||||||
|
|
||||||
type ColorModes = 'hex' | 'rgb' | 'hsl' | 'lab' | 'oklch';
|
type ColorModes = 'hex' | 'rgb' | 'hsl' | 'lab' | 'oklch';
|
||||||
|
@ -20,7 +21,11 @@ export function CardsDetail({ mainTag }: CardsDetailProps) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const embededCategories = colorFn.color_categories() as { label: string; value: string }[];
|
const embededCategories = colorFn.color_categories().map(mapToObject) as {
|
||||||
|
label: string;
|
||||||
|
value: string;
|
||||||
|
}[];
|
||||||
|
console.debug('[Fetch color categories]', embededCategories);
|
||||||
return embededCategories.filter((cate) => !isEqual(cate.value, 'unknown'));
|
return embededCategories.filter((cate) => !isEqual(cate.value, 'unknown'));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('[Fetch color categories]', e);
|
console.error('[Fetch color categories]', e);
|
||||||
|
|
|
@ -10,4 +10,7 @@ export default defineConfig({
|
||||||
cssModules: true,
|
cssModules: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
optimizeDeps: {
|
||||||
|
exclude: ['color-module'],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user