This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import chalk from 'chalk'; | |
| import path from 'path'; | |
| import errorCallSites from 'error-callsites'; | |
| import {SourceMapConsumer} from 'source-map'; | |
| import {retrieveSourceMap} from 'source-map-support/source-map-support'; | |
| const sourceMapCache = {}; | |
| const fileContentsCache = {}; | |
| export function supportRelativeURL(file, url) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import compact from 'lodash/fp/compact'; | |
| export const anchorColor = (color, hover = color, visited = color) => ({ | |
| '&': {color}, | |
| '&:hover, &:visited:hover': {color: hover}, | |
| '&:visited': {color: visited}, | |
| }); | |
| export const mediaQuery = (rules) => { | |
| let _rules = compact(rules); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sortBy from 'lodash/fp/sortBy'; | |
| import tinycolor from 'tinycolor2'; | |
| sortBy((color) => { | |
| const {s: saturation, l: lightness} = tinycolor(color).toHsl(); | |
| const darkness = (1 - lightness); | |
| const intensity = darkness * darkness * saturation * saturation; | |
| return lightness + intensity * 20; | |
| }, colors); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @flow | |
| /* eslint-env browser */ | |
| /* eslint-disable complexity */ | |
| // ============================================================================= | |
| // Import modules | |
| // ============================================================================= | |
| import React, {PureComponent} from 'react'; | |
| import {findDOMNode} from 'react-dom'; | |
| import classnames from 'classnames'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| declare module 're-reselect' { | |
| declare type Selector<S, P, R> = { | |
| (S, P, ...rest: any[]): R; | |
| }; | |
| declare type Resolver<S, P, K: number | string> = { | |
| (state: S, P, ...rest: any[]): K; | |
| }; | |
| declare type CachedSelectorCreator = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @flow | |
| type Result<T> = { | |
| url: string; | |
| status: number; | |
| body: T; | |
| }; | |
| type Handlers<T = mixed> = [ | |
| (Response) => Promise<Result<T>>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const patch = (target, func) => { | |
| const original = target[func]; | |
| target[func] = function () { | |
| return Promise.reolve(original.apply(this, arguments)); | |
| }; | |
| } | |
| const targets = [ | |
| [window, 'fetch'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const measureScrollbars = (): {width: number, height: number} => { | |
| const container = document.createElement('div'); | |
| container.style.width = '100px'; | |
| container.style.height = '100px'; | |
| container.style.overflow = 'scroll'; | |
| const liner = document.createElement('div'); | |
| liner.style.width = '200px'; | |
| liner.style.height = '200px'; |