修复或屏蔽编译错误。
This commit is contained in:
parent
f944d48e1b
commit
2ec3578e1c
|
@ -23,6 +23,7 @@ export function useColorFunction(): ColorFunctionContextType {
|
|||
}
|
||||
|
||||
export function ColorFunctionProvider({ children }: WasmProviderProps) {
|
||||
//@ts-expect-error TS2503
|
||||
const [wasmInstance, setWasmInstance] = useState<Wasm.InitOutput | null>(null);
|
||||
const [isPending, startTransition] = useTransition();
|
||||
const [error, setError] = useState<Error | null>(null);
|
||||
|
|
|
@ -194,6 +194,7 @@ export function Notifications({
|
|||
message={message}
|
||||
duration={duration ?? defaultDuration}
|
||||
closeAction={removeNotification}
|
||||
//@ts-expect-error TS2322
|
||||
ref={ref}
|
||||
/>
|
||||
);
|
||||
|
@ -233,9 +234,6 @@ export function Notifications({
|
|||
value={{
|
||||
addNotification,
|
||||
removeNotification,
|
||||
showDialog: () => '',
|
||||
showModalDialog: () => '',
|
||||
closeDialog: () => {},
|
||||
showToast,
|
||||
}}>
|
||||
{children}
|
||||
|
@ -245,6 +243,7 @@ export function Notifications({
|
|||
{notifications.slice(0, maxNotifications).map(({ id, element, ref }) => (
|
||||
<CSSTransition
|
||||
key={id}
|
||||
//@ts-expect-error TS2322
|
||||
nodeRef={ref}
|
||||
unmountOnExit
|
||||
timeout={500}
|
||||
|
@ -266,6 +265,7 @@ export function Notifications({
|
|||
{toasts.slice(0, 1).map(({ id, element, ref }) => (
|
||||
<CSSTransition
|
||||
key={id}
|
||||
//@ts-expect-error TS2322
|
||||
nodeRef={ref}
|
||||
unmountOnExit
|
||||
timeout={500}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { clamp } from 'lodash-es';
|
||||
import { RefObject, useEffect, useRef, useState, WheelEvent } from 'react';
|
||||
import { MouseEvent, RefObject, useEffect, useRef, useState, WheelEvent } from 'react';
|
||||
import styles from './ScrollArea.module.css';
|
||||
|
||||
type ScrollBarProps = {
|
||||
|
@ -12,10 +12,12 @@ function VerticalScrollBar({ containerRef }: ScrollBarProps) {
|
|||
const thumbRef = useRef<HTMLDivElement | null>(null);
|
||||
const handleMouseDown = (evt: MouseEvent) => {
|
||||
evt.preventDefault();
|
||||
//@ts-expect-error TS2769
|
||||
document.addEventListener('mousemove', handleMouseMove);
|
||||
//@ts-expect-error TS2769
|
||||
document.addEventListener('mouseup', handleMouseUp);
|
||||
};
|
||||
const handleMouseMove = (evt: MouseEvent) => {
|
||||
const handleMouseMove = (evt: MouseEvent<HTMLDivElement>) => {
|
||||
evt.preventDefault();
|
||||
const container = containerRef?.current;
|
||||
const scrollbar = trackRef.current;
|
||||
|
@ -34,7 +36,9 @@ function VerticalScrollBar({ containerRef }: ScrollBarProps) {
|
|||
};
|
||||
const handleMouseUp = (evt: MouseEvent) => {
|
||||
evt.preventDefault();
|
||||
//@ts-expect-error TS2769
|
||||
document.removeEventListener('mousemove', handleMouseMove);
|
||||
//@ts-expect-error TS2769
|
||||
document.removeEventListener('mouseup', handleMouseUp);
|
||||
};
|
||||
|
||||
|
@ -77,7 +81,9 @@ function HorizontalScrollBar({ containerRef }: ScrollBarProps) {
|
|||
const thumbRef = useRef<HTMLDivElement | null>(null);
|
||||
const handleMouseDown = (evt: MouseEvent) => {
|
||||
evt.preventDefault();
|
||||
//@ts-expect-error TS2769
|
||||
document.addEventListener('mousemove', handleMouseMove);
|
||||
//@ts-expect-error TS2769
|
||||
document.addEventListener('mouseup', handleMouseUp);
|
||||
};
|
||||
const handleMouseMove = (evt: MouseEvent) => {
|
||||
|
@ -99,7 +105,9 @@ function HorizontalScrollBar({ containerRef }: ScrollBarProps) {
|
|||
};
|
||||
const handleMouseUp = (evt: MouseEvent) => {
|
||||
evt.preventDefault();
|
||||
//@ts-expect-error TS2769
|
||||
document.removeEventListener('mousemove', handleMouseMove);
|
||||
//@ts-expect-error TS2769
|
||||
document.removeEventListener('mouseup', handleMouseUp);
|
||||
};
|
||||
|
||||
|
@ -129,7 +137,7 @@ function HorizontalScrollBar({ containerRef }: ScrollBarProps) {
|
|||
className={styles.h_thumb}
|
||||
ref={thumbRef}
|
||||
style={{ left: thumbPos }}
|
||||
onMouseDown={handleMouseDown}
|
||||
onMouseDown={(e) => handleMouseDown(e)}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -26,11 +26,14 @@ export function Switch({ name, checked = false, disabled = false, onChange }: Sw
|
|||
}, [checked]);
|
||||
|
||||
return (
|
||||
//@ts-expect-error TS2322
|
||||
<div className={styles.switch} disabled={disabled}>
|
||||
<div
|
||||
className={cx(styles.switch_handle, isChecked && styles.checked)}
|
||||
onClick={handleSwitch}></div>
|
||||
{!isNil(name) && <input type="hidden" name={name} value={isChecked} />}
|
||||
{!isNil(name) && (
|
||||
<input type="hidden" name={name} value={isChecked ? 'checked' : undefined} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,23 +1,14 @@
|
|||
import { useMemo } from 'react';
|
||||
import { HctDiffference } from '../../color_functions/color_module';
|
||||
import { Differ, HctDiffference } from '../../color_functions/color_module';
|
||||
import { useColorFunction } from '../../ColorFunctionContext';
|
||||
import styles from './CompareLayout.module.css';
|
||||
import { CompareMethodProps } from './share-props';
|
||||
|
||||
const defaultCompareResult: HctDiffference = {
|
||||
hue: {
|
||||
delta: 0,
|
||||
percent: 0,
|
||||
},
|
||||
chroma: {
|
||||
delta: 0,
|
||||
percent: 0,
|
||||
},
|
||||
lightness: {
|
||||
delta: 0,
|
||||
percent: 0,
|
||||
},
|
||||
};
|
||||
const defaultCompareResult: HctDiffference = new HctDiffference(
|
||||
new Differ(0, 0),
|
||||
new Differ(0, 0),
|
||||
new Differ(0, 0),
|
||||
);
|
||||
|
||||
export function HCTCompare({
|
||||
basic = '000000',
|
||||
|
|
|
@ -1,23 +1,14 @@
|
|||
import { useMemo } from 'react';
|
||||
import { HSLDifference } from '../../color_functions/color_module';
|
||||
import { Differ, HSLDifference } from '../../color_functions/color_module';
|
||||
import { useColorFunction } from '../../ColorFunctionContext';
|
||||
import styles from './CompareLayout.module.css';
|
||||
import { CompareMethodProps } from './share-props';
|
||||
|
||||
const defaultCompareResult: HSLDifference = {
|
||||
hue: {
|
||||
delta: 0,
|
||||
percent: 0,
|
||||
},
|
||||
saturation: {
|
||||
delta: 0,
|
||||
percent: 0,
|
||||
},
|
||||
lightness: {
|
||||
delta: 0,
|
||||
percent: 0,
|
||||
},
|
||||
};
|
||||
const defaultCompareResult: HSLDifference = new HSLDifference(
|
||||
new Differ(0, 0),
|
||||
new Differ(0, 0),
|
||||
new Differ(0, 0),
|
||||
);
|
||||
|
||||
export function HSLCompare({
|
||||
basic = '000000',
|
||||
|
|
|
@ -1,23 +1,14 @@
|
|||
import { useMemo } from 'react';
|
||||
import { OklchDifference } from '../../color_functions/color_module';
|
||||
import { Differ, OklchDifference } from '../../color_functions/color_module';
|
||||
import { useColorFunction } from '../../ColorFunctionContext';
|
||||
import styles from './CompareLayout.module.css';
|
||||
import { CompareMethodProps } from './share-props';
|
||||
|
||||
const defaultCompareResult: OklchDifference = {
|
||||
hue: {
|
||||
delta: 0,
|
||||
percent: 0,
|
||||
},
|
||||
chroma: {
|
||||
delta: 0,
|
||||
percent: 0,
|
||||
},
|
||||
lightness: {
|
||||
delta: 0,
|
||||
percent: 0,
|
||||
},
|
||||
};
|
||||
const defaultCompareResult: OklchDifference = new OklchDifference(
|
||||
new Differ(0, 0),
|
||||
new Differ(0, 0),
|
||||
new Differ(0, 0),
|
||||
);
|
||||
|
||||
export function OklchCompare({
|
||||
basic = '000000',
|
||||
|
|
|
@ -1,23 +1,14 @@
|
|||
import { useMemo } from 'react';
|
||||
import { RGBDifference } from '../../color_functions/color_module';
|
||||
import { Differ, RGBDifference } from '../../color_functions/color_module';
|
||||
import { useColorFunction } from '../../ColorFunctionContext';
|
||||
import styles from './CompareLayout.module.css';
|
||||
import { CompareMethodProps } from './share-props';
|
||||
|
||||
const defaultCompareResult: RGBDifference = {
|
||||
r: {
|
||||
delta: 0,
|
||||
percent: 0,
|
||||
},
|
||||
g: {
|
||||
delta: 0,
|
||||
percent: 0,
|
||||
},
|
||||
b: {
|
||||
delta: 0,
|
||||
percent: 0,
|
||||
},
|
||||
};
|
||||
const defaultCompareResult: RGBDifference = new RGBDifference(
|
||||
new Differ(0, 0),
|
||||
new Differ(0, 0),
|
||||
new Differ(0, 0),
|
||||
);
|
||||
|
||||
export function RGBCompare({
|
||||
basic = '000000',
|
||||
|
|
|
@ -5,12 +5,7 @@ import { useColorFunction } from '../../ColorFunctionContext';
|
|||
import styles from './CompareLayout.module.css';
|
||||
import { CompareMethodProps } from './share-props';
|
||||
|
||||
const defaultMixResult: MixReversing = {
|
||||
r_factor: 0,
|
||||
g_factor: 0,
|
||||
b_factor: 0,
|
||||
average: 0,
|
||||
};
|
||||
const defaultMixResult: MixReversing = new MixReversing(0, 0, 0, 0);
|
||||
|
||||
export function ShadeScale({ basic = '000000', compare = '000000' }: CompareMethodProps) {
|
||||
const { colorFn } = useColorFunction();
|
||||
|
|
|
@ -5,12 +5,7 @@ import { useColorFunction } from '../../ColorFunctionContext';
|
|||
import styles from './CompareLayout.module.css';
|
||||
import { CompareMethodProps } from './share-props';
|
||||
|
||||
const defaultMixResult: MixReversing = {
|
||||
r_factor: 0,
|
||||
g_factor: 0,
|
||||
b_factor: 0,
|
||||
average: 0,
|
||||
};
|
||||
const defaultMixResult: MixReversing = new MixReversing(0, 0, 0, 0);
|
||||
|
||||
export function TintScale({ basic = '000000', compare = '000000' }: CompareMethodProps) {
|
||||
const { colorFn } = useColorFunction();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { isEmpty } from 'lodash-es';
|
||||
import { ActionIcon } from '../../components/ActionIcon';
|
||||
import { FloatColorPicker } from '../../components/FloatcolorPicker';
|
||||
import { FloatColorPicker } from '../../components/FloatColorPicker';
|
||||
import styles from './colorEntry.module.css';
|
||||
|
||||
export type IdenticalColorEntry = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { includes, isEmpty, isNil, merge } from 'lodash-es';
|
||||
import { useActionState, useCallback, useMemo, useState } from 'react';
|
||||
import { useColorFunction } from '../../../ColorFunctionContext';
|
||||
import { FloatColorPicker } from '../../../components/FloatcolorPicker';
|
||||
import { FloatColorPicker } from '../../../components/FloatColorPicker';
|
||||
import { ScrollArea } from '../../../components/ScrollArea';
|
||||
import { MaterialDesign2SchemeStorage } from '../../../material-2-scheme';
|
||||
import { SchemeContent } from '../../../models';
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { includes, isEmpty, isNil } from 'lodash-es';
|
||||
import { useActionState, useCallback, useMemo, useState } from 'react';
|
||||
import { useColorFunction } from '../../../ColorFunctionContext';
|
||||
import { FloatColorPicker } from '../../../components/FloatcolorPicker';
|
||||
import { FloatColorPicker } from '../../../components/FloatColorPicker';
|
||||
import { ScrollArea } from '../../../components/ScrollArea';
|
||||
import { MaterialDesign3Scheme, MaterialDesign3SchemeStorage } from '../../../material-3-scheme';
|
||||
import { SchemeContent } from '../../../models';
|
||||
|
|
|
@ -7,7 +7,7 @@ import {
|
|||
WACGSetting,
|
||||
} from '../../../color_functions/color_module';
|
||||
import { useColorFunction } from '../../../ColorFunctionContext';
|
||||
import { FloatColorPicker } from '../../../components/FloatcolorPicker';
|
||||
import { FloatColorPicker } from '../../../components/FloatColorPicker';
|
||||
import { ScrollArea } from '../../../components/ScrollArea';
|
||||
import { VSegmentedControl } from '../../../components/VSegmentedControl';
|
||||
import { SchemeContent } from '../../../models';
|
||||
|
|
Loading…
Reference in New Issue
Block a user