Skip to content

Commit

Permalink
build: fix es-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pubuzhixing8 committed Dec 7, 2024
1 parent 31bcaeb commit 942ebad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
11 changes: 3 additions & 8 deletions packages/drawnix/src/plugins/freehand/freehand.generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@ import { Options } from 'roughjs/bin/core';
import { DefaultFreehand, Freehand } from './type';
import { gaussianSmooth } from './utils';

export interface FreehandData {}

export class FreehandGenerator extends Generator<Freehand, FreehandData> {
protected draw(
element: Freehand,
data?: FreehandData | undefined
): SVGGElement | undefined {
let option: Options = { ...DefaultFreehand };
export class FreehandGenerator extends Generator<Freehand> {
protected draw(element: Freehand): SVGGElement | undefined {
const option: Options = { ...DefaultFreehand };
const g = PlaitBoard.getRoughSVG(this.board).curve(
gaussianSmooth(element.points, 1, 9),
option
Expand Down
4 changes: 2 additions & 2 deletions packages/react-board/src/wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ export const Wrapper: React.FC<WrapperProps> = ({
});

return () => {
BOARD_TO_ON_CHANGE.set(board, () => {});
BOARD_TO_AFTER_CHANGE.set(board, () => {});
BOARD_TO_ON_CHANGE.delete(board);
BOARD_TO_AFTER_CHANGE.delete(board);
};
}, [board, onContextChange]);

Expand Down
2 changes: 1 addition & 1 deletion packages/react-text/src/plugins/with-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const withText = <T extends ReactEditor>(editor: T) => {

e.insertData = (data: DataTransfer) => {
let text = data.getData('text/plain');
let plaitData = data.getData(`application/x-slate-fragment`);
const plaitData = data.getData(`application/x-slate-fragment`);
if (!plaitData && text) {
if (text.endsWith('\n')) {
text = text.substring(0, text.length - 1);
Expand Down
3 changes: 1 addition & 2 deletions packages/react-text/src/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const Text: React.FC<TextComponentProps> = (
const editor = withText(withHistory(withReact(createEditor())));
afterInit && afterInit(editor);
return editor;
}, []);
}, [afterInit]);
return (
<Slate
editor={editor}
Expand All @@ -44,7 +44,6 @@ export const Text: React.FC<TextComponentProps> = (
renderElement={renderElement}
renderLeaf={renderLeaf}
readOnly={readonly === undefined ? true : readonly}
onKeyDown={(event) => {}}
onCompositionStart={(event) => {
if (onComposition) {
onComposition(event as unknown as CompositionEvent);
Expand Down

0 comments on commit 942ebad

Please sign in to comment.