Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens committed Dec 30, 2024
1 parent 6fefe98 commit 08cabca
Show file tree
Hide file tree
Showing 63 changed files with 383 additions and 382 deletions.
4 changes: 2 additions & 2 deletions packages/alignment/src/lib/__tests__/setAlign/center.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const output = (

it('should align center', () => {
const editor = createSlateEditor({
value: input.children,
selection: input.selection,
plugins: [BaseAlignPlugin],
selection: input.selection,
value: input.children,
});

setAlign(editor, { value: 'center' });
Expand Down
4 changes: 2 additions & 2 deletions packages/alignment/src/lib/__tests__/setAlign/left.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const output = (

it('should remove align prop', () => {
const editor = createSlateEditor({
value: input.children,
selection: input.selection,
plugins: [BaseAlignPlugin],
selection: input.selection,
value: input.children,
});

setAlign(editor, { value: 'start' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ describe('when type (h1) is not in types', () => {

it('should not align', () => {
const editor = createSlateEditor({
value: input.children,
selection: input.selection,
plugins: [BaseAlignPlugin],
selection: input.selection,
value: input.children,
});

setAlign(editor, { value: 'center' });
Expand Down
1 change: 1 addition & 0 deletions packages/cmdk/src/cmdk.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable react-hooks/exhaustive-deps */
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable react/no-unknown-property */
Expand Down
4 changes: 2 additions & 2 deletions packages/code-block/src/lib/insertDataCodeBlock.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const editorTest = (input: any, data: DataTransfer, expected: any) => {
const plugins = [BaseParagraphPlugin, CodeBlockPlugin];

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins,
selection: input.selection,
value: input.children,
});

editor.insertData(data);
Expand Down
4 changes: 2 additions & 2 deletions packages/code-block/src/lib/insertFragmentCodeBlock.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jsxt;

const editorTest = (input: any, fragment: any, expected: any) => {
const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [BaseParagraphPlugin, CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

editor.insertFragment(fragment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ describe('clean up code block', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

const path = [0];
Expand Down
12 changes: 6 additions & 6 deletions packages/code-block/src/lib/transforms/indentCodeLine.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ describe('indent code line', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

const codeBlock = getNodeEntry(editor, [0]) as TElementEntry;
Expand Down Expand Up @@ -83,9 +83,9 @@ describe('indent code line', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

const codeBlock = getNodeEntry(editor, [0]) as TElementEntry;
Expand Down Expand Up @@ -124,9 +124,9 @@ describe('indent code line', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

const codeBlock = getNodeEntry(editor, [0]) as TElementEntry;
Expand Down
12 changes: 6 additions & 6 deletions packages/code-block/src/lib/transforms/insertCodeBlock.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ describe('insert code block', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

insertCodeBlock(editor);
Expand Down Expand Up @@ -77,9 +77,9 @@ describe('insert code block', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

insertCodeBlock(editor);
Expand Down Expand Up @@ -117,9 +117,9 @@ describe('insert code block', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

insertCodeBlock(editor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ describe('insert code line', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

insertCodeLine(editor, 4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ describe('insert empty code block', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

insertEmptyCodeBlock(editor, {
Expand Down Expand Up @@ -65,9 +65,9 @@ describe('insert empty code block', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

insertEmptyCodeBlock(editor, {
Expand Down Expand Up @@ -108,9 +108,9 @@ describe('insert empty code block', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

insertEmptyCodeBlock(editor, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ describe('outdent code line', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

const codeBlock = getNodeEntry(editor, [0]) as TElementEntry;
Expand Down Expand Up @@ -66,9 +66,9 @@ describe('outdent code line', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

const codeBlock = getNodeEntry(editor, [0]) as TElementEntry;
Expand Down
12 changes: 6 additions & 6 deletions packages/code-block/src/lib/transforms/toggleCodeBlock.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ describe('toggle on', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

toggleCodeBlock(editor);
Expand Down Expand Up @@ -69,9 +69,9 @@ describe('toggle on', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

toggleCodeBlock(editor);
Expand Down Expand Up @@ -109,9 +109,9 @@ describe('toggle on', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

toggleCodeBlock(editor);
Expand Down
12 changes: 6 additions & 6 deletions packages/code-block/src/lib/transforms/unwrapCodeBlock.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ describe('unwrap code block', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

unwrapCodeBlock(editor);
Expand Down Expand Up @@ -84,9 +84,9 @@ describe('unwrap code block', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

unwrapCodeBlock(editor);
Expand Down Expand Up @@ -127,9 +127,9 @@ describe('unwrap code block', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

unwrapCodeBlock(editor);
Expand Down
4 changes: 2 additions & 2 deletions packages/code-block/src/lib/withCodeBlock.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ describe('insert break', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

editor.insertBreak();
Expand Down
12 changes: 6 additions & 6 deletions packages/code-block/src/react/CodeBlockPlugin.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ describe('code block deserialization', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [
BaseParagraphPlugin,
CodeBlockPlugin,
Expand All @@ -49,6 +47,8 @@ describe('code block deserialization', () => {
},
}),
],
selection: input.selection,
value: input.children,
});

editor.insertData({
Expand Down Expand Up @@ -78,9 +78,9 @@ describe('code block deserialization', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [BaseParagraphPlugin, CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

editor.insertData({
Expand Down Expand Up @@ -119,9 +119,9 @@ describe('code block deserialization', () => {
) as any as SlateEditor;

const editor = createPlateEditor({
value: input.children,
selection: input.selection,
plugins: [BaseParagraphPlugin, CodeBlockPlugin],
selection: input.selection,
value: input.children,
});

editor.deleteBackward('character');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ describe('delete marked text at block start', () => {
) as any;

const editor = createPlateEditor({
selection: input.selection,
value: input.children,
selection: input.selection,
});

editor.deleteBackward('character');
Expand Down Expand Up @@ -60,8 +60,8 @@ describe('delete marked text at block start', () => {
) as any;

const editor = createPlateEditor({
selection: input.selection,
value: input.children,
selection: input.selection,
});

editor.deleteForward('character');
Expand Down Expand Up @@ -91,8 +91,8 @@ describe('delete marked text at block start', () => {
) as any;

const editor = createPlateEditor({
selection: input.selection,
value: input.children,
selection: input.selection,
});

editor.deleteBackward('character');
Expand All @@ -117,8 +117,8 @@ describe('editor.tf.setValue', () => {
) as any;

const editor = createPlateEditor({
selection: input.selection,
value: input.children,
selection: input.selection,
});

editor.tf.setValue('<p>new content</p>');
Expand All @@ -142,8 +142,8 @@ describe('editor.tf.setValue', () => {
) as any;

const editor = createPlateEditor({
selection: input.selection,
value: input.children,
selection: input.selection,
});

editor.tf.setValue();
Expand Down
Loading

0 comments on commit 08cabca

Please sign in to comment.