Skip to content

Commit

Permalink
npx lerna exec tsfmt -- -r
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerbutler committed May 27, 2020
1 parent 3d17571 commit a69171c
Show file tree
Hide file tree
Showing 170 changed files with 997 additions and 990 deletions.
4 changes: 2 additions & 2 deletions components/examples/badge/src/BadgeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,11 @@ function getRelativeDate(timestamp: Date): string {
} else if (delta < 3 * minute) {
return "a few minutes ago";
} else if (delta < hour) {
return `${Math.floor(delta / minute) } minutes ago`;
return `${Math.floor(delta / minute)} minutes ago`;
} else if (Math.floor(delta / hour) < 3) {
return "a few hours ago.";
} else if (delta < day) {
return `${Math.floor(delta / hour) } hours ago`;
return `${Math.floor(delta / hour)} hours ago`;
} else if (delta < day * 2) {
return "yesterday";
} else {
Expand Down
2 changes: 1 addition & 1 deletion components/examples/clicker/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class Clicker extends PrimedComponent implements IComponentHTMLView {
* Will return a new Clicker view
*/
public render(div: HTMLElement) {
// Get our counter object that we set in initialize and pass it in to the view.
// Get our counter object that we set in initialize and pass it in to the view.
const counter = this.root.get("clicks");
ReactDOM.render(
<CounterReactView counter={counter} />,
Expand Down
2 changes: 1 addition & 1 deletion components/examples/collaborative-textarea/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class CollaborativeText extends PrimedComponent implements IComponentHTML

ReactDOM.render(
<div className="text-area">
<CollaborativeTextArea sharedString={this.text}/>
<CollaborativeTextArea sharedString={this.text} />
</div>,
div,
);
Expand Down
2 changes: 1 addition & 1 deletion components/examples/dice-roller/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class DiceRoller extends PrimedComponent implements IDiceRoller, ICompone
*/
public render(div: HTMLElement) {
ReactDOM.render(
<DiceRollerView model={ this } />,
<DiceRollerView model={this} />,
div,
);
}
Expand Down
2 changes: 1 addition & 1 deletion components/examples/pond/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class Pond extends PrimedComponent implements IComponentHTMLView {

const index = document.createElement("h4");
index.innerText =
`dotted borders denote different component boundaries`;
`dotted borders denote different component boundaries`;

div.appendChild(title);
div.appendChild(index);
Expand Down
2 changes: 1 addition & 1 deletion components/examples/pond/src/interfaces/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ declare module "@fluidframework/component-core-interfaces" {
export interface IComponent extends Readonly<Partial<IProvideComponentUserInformation>> { }
}

export const IComponentUserInformation: keyof IProvideComponentUserInformation = "IComponentUserInformation";
export const IComponentUserInformation: keyof IProvideComponentUserInformation = "IComponentUserInformation";

export interface IProvideComponentUserInformation {
readonly IComponentUserInformation: IComponentUserInformation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class ClickerWithInitialValue extends PrimedComponent<{}, IClickerInitial
// Get our counter object that we set in initialize and pass it in to the view.
const counter = this.root.get("clicks");
ReactDOM.render(
<CounterReactView directory={this.root}counter={counter} />,
<CounterReactView directory={this.root} counter={counter} />,
div,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ const pkg = require("../../package.json");
*/
export class ExampleUsingProviders
extends PrimedComponent<IComponentUserInformation>
implements IComponentHTMLView
{
implements IComponentHTMLView {
public get IComponentHTMLView() { return this; }

private userInformation: IComponentUserInformation | undefined;
Expand All @@ -37,7 +36,7 @@ export class ExampleUsingProviders
public render(div: HTMLElement) {
let element: JSX.Element = <span></span>;
if (this.userInformation) {
element = <ExampleUsingProvidersView userInfo={this.userInformation}/>;
element = <ExampleUsingProvidersView userInfo={this.userInformation} />;
} else {
console.log("No IComponentUserInformation Provided");
}
Expand Down Expand Up @@ -90,11 +89,11 @@ class ExampleUsingProvidersView

public render() {
const users: JSX.Element[] = [];
this.state.users.forEach((user)=> {
this.state.users.forEach((user) => {
users.push(<div>{user}</div>);
});
return (
<div style={{ border:"1px dotted green" }}>
<div style={{ border: "1px dotted green" }}>
<h3>Provider Information</h3>
<div><b>Count:</b></div>
<div>{this.state.count}</div>
Expand Down
4 changes: 2 additions & 2 deletions components/examples/simple-component-embed/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export class SimpleComponentEmbed extends PrimedComponent implements IComponentH
}

public render(div: HTMLDivElement) {
// Create a div that we will use to embed the component
// and attach that div to the page
// Create a div that we will use to embed the component
// and attach that div to the page
const componentDiv = document.createElement("div");
componentDiv.id = "componentDiv";
div.appendChild(componentDiv);
Expand Down
20 changes: 10 additions & 10 deletions components/experimental/canvas/src/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ import { IComponentHTMLOptions, IComponentHTMLView } from "@fluidframework/view-
import "./style.less";

const colorPickerColors: IColor[] = [
{ r: 253, g: 0, b: 12, a: 1 },
{ r: 134, g: 0, b: 56, a: 1 },
{ r: 253, g: 187, b: 48, a: 1 },
{ r: 255, g: 255, b: 81, a: 1 },
{ r: 0, g: 45, b: 98, a: 1 },
{ r: 253, g: 0, b: 12, a: 1 },
{ r: 134, g: 0, b: 56, a: 1 },
{ r: 253, g: 187, b: 48, a: 1 },
{ r: 255, g: 255, b: 81, a: 1 },
{ r: 0, g: 45, b: 98, a: 1 },
{ r: 255, g: 255, b: 255, a: 1 },
{ r: 246, g: 83, b: 20, a: 1 },
{ r: 0, g: 161, b: 241, a: 1 },
{ r: 124, g: 187, b: 0, a: 1 },
{ r: 8, g: 170, b: 51, a: 1 },
{ r: 0, g: 0, b: 0, a: 1 },
{ r: 246, g: 83, b: 20, a: 1 },
{ r: 0, g: 161, b: 241, a: 1 },
{ r: 124, g: 187, b: 0, a: 1 },
{ r: 8, g: 170, b: 51, a: 1 },
{ r: 0, g: 0, b: 0, a: 1 },
];

export class Canvas extends PrimedComponent implements IComponentHTMLView {
Expand Down
2 changes: 1 addition & 1 deletion components/experimental/draft-js/src/MemberList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class MemberList extends React.Component<IProps, IState> {
.getMembers()
.entries(),
)
.filter(([id, _]) => this.knownHumanMemberIds.has(id))
.filter(([id, _]) => this.knownHumanMemberIds.has(id))
.map(([id, sc]) => {
let name: string = (sc.client.user as any).displayName || (sc.client.user as any).name;
let initials: string;
Expand Down
18 changes: 9 additions & 9 deletions components/experimental/draft-js/src/RichTextAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ const sharedTextStylePropToDraft = (prop: {}): OrderedSet<string> => {
};

export const selectionToBlockRange = (selection: SelectionState): BlockTextRange => ({
startKey: selection.getStartKey(),
startOffset: selection.getStartOffset(),
endKey: selection.getEndKey(),
endOffset: selection.getEndOffset(),
startKey: selection.getStartKey(),
startOffset: selection.getStartOffset(),
endKey: selection.getEndKey(),
endOffset: selection.getEndOffset(),
});

export const blockRangeToSelection = (range: BlockTextRange, hasFocus: boolean): SelectionState => new SelectionState({
anchorKey: range.startKey,
anchorOffset: range.startOffset,
focusKey: range.endKey,
focusOffset: range.endOffset,
hasFocus,
anchorKey: range.startKey,
anchorOffset: range.startOffset,
focusKey: range.endKey,
focusOffset: range.endOffset,
hasFocus,
});

export const textRangeToBlockTextRangeFromBlocks = (absPos: TextRange, blocks: ContentBlock[]): BlockTextRange => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class UrlRegistry implements IComponentRegistry {
return this.urlRegistryMap.get(name);
}

private async loadEntrypoint(name: string): Promise<IComponent| undefined> {
private async loadEntrypoint(name: string): Promise<IComponent | undefined> {
if (this.isUrl(name)) {
if (!this.loadingPackages.has(name)) {
this.loadingPackages.set(name, this.loadPackage(name));
Expand All @@ -57,8 +57,8 @@ export class UrlRegistry implements IComponentRegistry {
const fluidPackage = await this.loadingPackages.get(name) ?? name;
const codeDetails: IFluidCodeDetails = {
package: fluidPackage,
config:{
cdn:"https://pragueauspkn-3873244262.azureedge.net",
config: {
cdn: "https://pragueauspkn-3873244262.azureedge.net",
},
};
const fluidModule = await this.webloader.load(codeDetails);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ export const WaterParkView: React.FC<IWaterParkViewProps> = (props: React.PropsW
return (
<>
<WaterParkToolbar
componentUrls={ componentUrls }
onSelectOption={ props.onSelectOption }
toggleEditable={ () => setEditable(!editable) }
componentUrls={componentUrls}
onSelectOption={props.onSelectOption}
toggleEditable={() => setEditable(!editable)}
/>
<SpacesStorageView storage={props.storage} editable={editable} />
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const WaterParkToolbar: React.FC<WaterParkToolbarViewProps> =
const datalistId = uuid();

const datalistOptions = props.componentUrls.map((member) => {
return <option value={ member } key={ member }></option>;
return <option value={member} key={member}></option>;
});

const inputRef = React.createRef<HTMLInputElement>();
Expand Down Expand Up @@ -50,25 +50,25 @@ export const WaterParkToolbar: React.FC<WaterParkToolbarViewProps> =
};

const errorElement = errorText !== undefined
? <div>{ errorText }</div>
? <div>{errorText}</div>
: undefined;

return (
<div className="waterpark-toolbar">
<datalist id={datalistId}>
{ datalistOptions }
{datalistOptions}
</datalist>
<input
ref={ inputRef }
list={ datalistId }
ref={inputRef}
list={datalistId}
type="text"
placeholder="@fluid-example/component-name@version"
style={{ width: "100%" }}
onKeyUp={ inputKeyUpHandler }
onKeyUp={inputKeyUpHandler}
/>
<button onClick={ pickComponent }>Add Component</button>
<button onClick={ props.toggleEditable }>Toggle Edit</button>
{ errorElement }
<button onClick={pickComponent}>Add Component</button>
<button onClick={props.toggleEditable}>Toggle Edit</button>
{errorElement}
</div>
);
};
20 changes: 10 additions & 10 deletions components/experimental/flow-util-lib/src/char.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
*/

export const enum Char {
tab = "\u0009",
newline = "\u000A",
lineTabulation = "\u000B",
formFeed = "\u000C",
carriageReturn = "\u000D",
space = " ",
enSpace = "\u2002",
emSpace = "\u2003",
zeroWidthSpace = "\u200B",
replacementCharacter = "\uFFFD",
tab = "\u0009",
newline = "\u000A",
lineTabulation = "\u000B",
formFeed = "\u000C",
carriageReturn = "\u000D",
space = " ",
enSpace = "\u2002",
emSpace = "\u2003",
zeroWidthSpace = "\u200B",
replacementCharacter = "\uFFFD",
}

0 comments on commit a69171c

Please sign in to comment.