Skip to content

Commit

Permalink
style: clean up console.log statements
Browse files Browse the repository at this point in the history
  • Loading branch information
ifiokjr committed Mar 20, 2019
1 parent 909adc1 commit 0c42140
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 46 deletions.
19 changes: 0 additions & 19 deletions @remirror/core-extensions/src/extensions/composition/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,18 @@ export class CompositionState {
}

public startDelete() {
// console.log('starting delete');
this.deleteInProgress = true;
this.active = true;
return this;
}

public endDelete(selection: Selection) {
// console.log('ending delete');
this.deleteInProgress = false;
this.selection = selection;
return this;
}

public resetState() {
// console.log('resetting the compositionState');
this.active = false;
this.deleteInProgress = false;
this.selection = undefined;
Expand All @@ -44,9 +41,7 @@ export class CompositionState {

public apply() {
if (this.lastTransactionFiltered) {
// console.log('apply: resetting state in apply');
this.resetState();
// console.log('apply: dispatching state selection');
// this.view.dispatch(tr.setSelection(state.selection));
}
return this;
Expand All @@ -61,13 +56,9 @@ export class CompositionState {
}
const tr = transactions[0];
if (!tr.steps.length && this.active && !this.deleteInProgress && this.selection) {
// console.log('appendTransaction: resetting state');
// this.resetState();
// console.log('appendTransaction: setting lastTransactionFiltered=true');
this.lastTransactionFiltered = true;
// console.log('appendTransaction: dispatching the stored selection');
// this.view.dispatch(tr.setSelection(this.selection));
// console.log('appendTransaction: returning transaction');
return tr.setSelection(this.selection);
}
return undefined;
Expand All @@ -80,24 +71,18 @@ export class CompositionState {
return true;
}
if (!tr.steps.length && this.active && !this.deleteInProgress && this.selection) {
// console.log('filterTransaction: setting lastTransactionFiltered=true');
this.lastTransactionFiltered = true;
// console.log('filterTransaction: dispatching the stored selection');
this.view.dispatch(tr.setSelection(this.selection));
// console.log('filterTransaction: resetting state');
this.resetState();
// this.setViewFocus = true;
// console.log('filterTransaction: focusing the view');
// this.view.focus();
// console.log('filterTransaction: returning false');
// return false;
}
return true;
}

public viewUpdate() {
// if (this.setViewFocus) {
// // console.log('viewUpdate: setting view focus', this.view.hasFocus());
// if (this.view.hasFocus()) {
// return;
// // (this.view.dom as HTMLElement).blur();
Expand All @@ -112,16 +97,13 @@ export class CompositionState {
// const { doc, selection } = state;
// const { $from } = selection;
// if (!nodeNameMatchesList($from.nodeBefore, ['emoji'])) {
// // console.log('not emoji before');
// this.decorationTicks = 0;
// return null;
// }
// if (this.deleteInProgress) {
// // console.log('delete in progress');
// this.decorationTicks = 2;
// }
// if (this.decorationTicks > 0) {
// // console.log('decoration: being added');
// this.decorationTicks--;
// const node = document.createElement('span');
// node.appendChild(document.createTextNode(ZERO_WIDTH_SPACE_CHAR));
Expand All @@ -131,7 +113,6 @@ export class CompositionState {
// } as any);
// return DecorationSet.create(doc, [decoration]);
// }
// console.log('decoration: being removed');
return null;
}
}
4 changes: 1 addition & 3 deletions @remirror/core/src/helpers/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ export const isAndroidOS = () => {
if (!match) {
return false;
}
const outcome = cleanupOS(match[0], 'Android', 'Android');
console.log('The outcome is', outcome);
return outcome.includes('Android');
return cleanupOS(match[0], 'Android', 'Android').includes('Android');
};

/**
Expand Down
7 changes: 0 additions & 7 deletions @remirror/react/src/__tests__/remirror-placeholder.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,7 @@ test('should display a placeholder when the content is empty', () => {
</Remirror>,
);

// console.log(document.documentElement.outerHTML);
// const target = `.${EDITOR_CLASS_NAME} p.${EMPTY_NODE_CLASS_NAME}:first-of-type::before`;
// expect(baseElement).toHaveStyleRule('content', placeholderText, {
// target,
// });

const emptyNode = baseElement.querySelector(`.${EMPTY_NODE_CLASS_NAME}`) as HTMLElement;
// console.log(window.getComputedStyle(emptyNode, ':before').content);
expect(emptyNode).toBeVisible();
expect(getByLabelText(label)).toHaveAttribute('aria-placeholder', placeholderText);
});
Expand Down
4 changes: 1 addition & 3 deletions @remirror/ui-twitter/src/components/ui-twitter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ export class TwitterUI extends PureComponent<TwitterUIProps, State> {
}
}

private onChange: RemirrorEventListener = ({}) => {
// console.log(getJSON());
};
private onChange: RemirrorEventListener = ({}) => {};

get userMatches(): ActiveTwitterUserData[] {
return this.props.userData.map((user, index) => ({
Expand Down
1 change: 0 additions & 1 deletion packages/jest-remirror/src/keys/__tests__/keyboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ describe('mod', () => {
expect(event!.shiftKey).toBeTrue();
expect(event!.metaKey).toBeFalse();

console.log(JSON.stringify(events));
expect(events).toEqual([
['keydown', 'Shift'],
['keydown', char],
Expand Down
13 changes: 0 additions & 13 deletions support/jest/puppeteer-coverage.ts

This file was deleted.

0 comments on commit 0c42140

Please sign in to comment.