<commit_before>'use strict'

const { h, Component } = require('preact')
const { css } = require('glamor')

const isClient = require('../utils/isClient')
const eventPos = require('../utils/eventPos')
const mousePos = require('../utils/mousePos')

const style = {

	self: css({
		flex: '0 0 auto',
		display: 'flex',
		justifyContent: 'center',
		alignItems: 'center',
		padding: '.4em',
		'> *': {
			opacity: 0
		},
		'&:hover > *': {
			opacity: 1
		}
	}),

	selfVertical: css({
		flexDirection: 'column',
		cursor: 'ns-resize'
	}),

	selfHorizontal: css({
		flexDirection: 'row',
		cursor: 'ew-resize'
	}),

	handle: css({
		margin: '.5px',
		background: 'rgba(0, 0, 0, .15)',
		transition: 'opacity .3s ease'
	}),

	handleVertical: css({
		width: '30px',
		height: '1px'
	}),

	handleHorizontal: css({
		width: '1px',
		height: '30px'
	})

}

module.exports = class extends Component {

	constructor(props) {

		super(props)

		this.setState({
			isResizing: false,
			startPos: null
		})

	}

	onMouseDown(e) {

		console.log('start')

		this.setState({
			isResizing: true,
			startPos: this.state.startPos || eventPos(e)
		})<commit_msg>Stop resizing on mouse up<commit_after>'use strict'

const { h, Component } = require('preact')
const { css } = require('glamor')

const isClient = require('../utils/isClient')
const eventPos = require('../utils/eventPos')
const mousePos = require('../utils/mousePos')

const style = {

	self: css({
		flex: '0 0 auto',
		display: 'flex',
		justifyContent: 'center',
		alignItems: 'center',
		padding: '.4em',
		'> *': {
			opacity: 0
		},
		'&:hover > *': {
			opacity: 1
		}
	}),

	selfVertical: css({
		flexDirection: 'column',
		cursor: 'ns-resize'
	}),

	selfHorizontal: css({
		flexDirection: 'row',
		cursor: 'ew-resize'
	}),

	handle: css({
		margin: '.5px',
		background: 'rgba(0, 0, 0, .15)',
		transition: 'opacity .3s ease'
	}),

	handleVertical: css({
		width: '30px',
		height: '1px'
	}),

	handleHorizontal: css({
		width: '1px',
		height: '30px'
	})

}

module.exports = class extends Component {

	constructor(props) {

		super(props)

		this.setState({
			isResizing: false
		})

	}

	onMouseDown(e) {

		console.log('start')

		this.setState({
			isResizing: true,
			startPos: this.state.startPos || eventPos(e)
		})

		document.documentElement.onmouseup = () => {

			this.setState({
				isResizing: false
			})

		}
{'fraction_non_alphanumeric': 0.18445378151260505, 'fraction_numerical': 0.015126050420168067, 'mean_word_length': 3.4092592592592594, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3276462', 'n_tokens_mistral': 998, 'n_tokens_neox': 874, 'n_words': 196}