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 PropTypes from 'prop-types'; | |
| import React, { Component, cloneElement } from 'react'; | |
| import {findDOMNode} from 'react-dom'; | |
| import Transition from 'react-addons-css-transition-group'; | |
| import {Gateway} from 'react-gateway'; | |
| import Outside from 'react-click-outside'; | |
| import classnames from 'classnames'; | |
| import withinBoundaries from './withinBoundaries'; | |
| // @TODO: Animations. This became "undoable" when we added boundary checking |
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
| class PassContext extends React.Component { | |
| getChildContext() { | |
| return { | |
| dragDropManager: this.props.dragDropManager | |
| }; | |
| } | |
| render() { | |
| return this.props.children; | |
| } |
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 React, {Component, PropTypes as T} from 'react'; | |
| import history from 'app/history'; | |
| class SearchInput extends Component { | |
| constructor(props, context) { | |
| super(props); | |
| this.state = { | |
| input: context.location.query.search || '' | |
| } |
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 React, {Component, PropTypes as T} from 'react'; | |
| export default class Column extends Component { | |
| render() { | |
| return null; | |
| } | |
| } | |
| Column.propTypes = { | |
| heading: T.string, |
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
| /** | |
| * Get placeholder index, like for example in a list, through node top offset. | |
| * Used for drag-n-drops. | |
| * | |
| * @param {number} y The actual top offset | |
| * @param {number} scroll Scroll count | |
| * @return {number} | |
| */ | |
| function getPlaceholderIndex(y, scroll) { | |
| const height = 70; |
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
| function rle(input) { | |
| let result = '' | |
| while (input.length) { | |
| const capture = new RegExp(`${input[0]}+`) | |
| const captured = capture.exec(input)[0] | |
| result += `${captured.length}${captured[0]}` | |
| input = input.substr(captured.length) | |
| } |
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 React, {Component, createElement, DOM} from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import c from 'classnames'; | |
| import ProgressBar from 'app/components/ProgressBar'; | |
| import Icon from 'app/components/Icon'; | |
| import mime from 'mime'; | |
| import axios from 'axios'; | |
| import put from '101/put'; | |
| import del from '101/del'; |
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
| /** | |
| * Immutably insert attachments | |
| * | |
| * @example | |
| * insert([null, null, null, null, 5, null], 2, 9) | |
| * [null, null, 9, null, null, 5, null] | |
| * | |
| * @param {array} array | |
| * @param {number} index | |
| * @param {mixed} value |
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
| /** | |
| * Converts array to object with sparse values. | |
| * Useful when for example, using a dictionary to set mass ids to a value | |
| * { loading: { 1: true, 4: true } } | |
| * | |
| * @param {array} array Primitive values | |
| * @return {object} | |
| */ | |
| export default function objectify(array, value) { | |
| const result = {}; |