mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Cleanup (rename HyperTerm to Hyper) (#812)
* Rename container * Rename hyper container itself * Add HYPER_DEBUG for debug * Rename HyperTerm to Hyper * Rename HyperTerm connector and extension * Add HyperTerm state and dispatch for backwards compatibility
This commit is contained in:
parent
2ffc1aee3d
commit
aa285a8bc6
6 changed files with 30 additions and 17 deletions
|
|
@ -113,9 +113,9 @@ app.on('ready', () => installDevExtensions(isDev).then(() => {
|
|||
backgroundColor: toElectronBackgroundColor(cfg.backgroundColor || '#000'),
|
||||
transparent: true,
|
||||
icon: resolve(__dirname, 'static/icon.png'),
|
||||
// we only want to show when the prompt
|
||||
// is ready for user input
|
||||
show: process.env.HYPERTERM_DEBUG || isDev,
|
||||
// we only want to show when the prompt is ready for user input
|
||||
// HYPERTERM_DEBUG for backwards compatibility with hyperterm
|
||||
show: process.env.HYPER_DEBUG || process.env.HYPERTERM_DEBUG || isDev,
|
||||
x: startX,
|
||||
y: startY
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ const localPath = resolve(homedir(), '.hyper_plugins', 'local');
|
|||
const availableExtensions = new Set([
|
||||
'onApp', 'onWindow', 'onUnload', 'middleware',
|
||||
'reduceUI', 'reduceSessions', 'decorateMenu',
|
||||
'decorateTerm', 'decorateHyperTerm', 'decorateTab',
|
||||
'decorateTerm', 'decorateHyper', 'decorateTab',
|
||||
'decorateHyperTerm', // for backwards compatibility with hyperterm
|
||||
'decorateNotification', 'decorateNotifications',
|
||||
'decorateTabs', 'decorateConfig', 'decorateEnv'
|
||||
]);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import NotificationsContainer from './notifications';
|
|||
|
||||
const isMac = /Mac/.test(navigator.userAgent);
|
||||
|
||||
class HyperTerm extends Component {
|
||||
class Hyper extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.handleFocusActive = this.handleFocusActive.bind(this);
|
||||
|
|
@ -132,7 +132,7 @@ class HyperTerm extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
const HyperTermContainer = connect(
|
||||
const HyperContainer = connect(
|
||||
state => {
|
||||
return {
|
||||
isMac,
|
||||
|
|
@ -159,6 +159,6 @@ const HyperTermContainer = connect(
|
|||
},
|
||||
null,
|
||||
{withRef: true}
|
||||
)(HyperTerm, 'HyperTerm');
|
||||
)(Hyper, 'Hyper');
|
||||
|
||||
export default HyperTermContainer;
|
||||
export default HyperContainer;
|
||||
|
|
@ -17,7 +17,7 @@ const oldMouse = hterm.Terminal.prototype.onMouse_;
|
|||
hterm.Terminal.prototype.onMouse_ = function (e) {
|
||||
if (e.type === 'dblclick') {
|
||||
selection.extend(this);
|
||||
console.log('[hyperterm+hterm] ignore double click');
|
||||
console.log('[hyper+hterm] ignore double click');
|
||||
return;
|
||||
}
|
||||
return oldMouse.call(this, e);
|
||||
|
|
@ -37,7 +37,7 @@ hterm.Terminal.prototype.copySelectionToClipboard = function () {
|
|||
};
|
||||
|
||||
// passthrough all the commands that are meant to control
|
||||
// hyperterm and not the terminal itself
|
||||
// hyper and not the terminal itself
|
||||
const oldKeyDown = hterm.Keyboard.prototype.onKeyDown_;
|
||||
hterm.Keyboard.prototype.onKeyDown_ = function (e) {
|
||||
const modifierKeysConf = this.terminal.modifierKeys;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import * as sessionActions from './actions/sessions';
|
|||
import * as termGroupActions from './actions/term-groups';
|
||||
import {addNotificationMessage} from './actions/notifications';
|
||||
import {loadConfig, reloadConfig} from './actions/config';
|
||||
import HyperTermContainer from './containers/hyperterm';
|
||||
import HyperContainer from './containers/hyper';
|
||||
import configureStore from './store/configure-store';
|
||||
|
||||
// Disable pinch zoom
|
||||
|
|
@ -130,7 +130,7 @@ rpc.on('add notification', ({text, url, dismissable}) => {
|
|||
|
||||
const app = render(
|
||||
<Provider store={store_}>
|
||||
<HyperTermContainer/>
|
||||
<HyperContainer/>
|
||||
</Provider>,
|
||||
document.getElementById('mount')
|
||||
);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ const loadModules = () => {
|
|||
connectors = {
|
||||
Terms: {state: [], dispatch: []},
|
||||
Header: {state: [], dispatch: []},
|
||||
HyperTerm: {state: [], dispatch: []},
|
||||
Hyper: {state: [], dispatch: []},
|
||||
Notifications: {state: [], dispatch: []}
|
||||
};
|
||||
uiReducers = [];
|
||||
|
|
@ -99,6 +99,18 @@ const loadModules = () => {
|
|||
}
|
||||
}
|
||||
|
||||
// mapHyperTermState mapping for backwards compatibility with hyperterm
|
||||
if (mod.mapHyperTermState) {
|
||||
mod.mapHyperState = mod.mapHyperTermState;
|
||||
console.error('mapHyperTermState is deprecated. Use mapHyperState instead.');
|
||||
}
|
||||
|
||||
// mapHyperTermDispatch mapping for backwards compatibility with hyperterm
|
||||
if (mod.mapHyperTermDispatch) {
|
||||
mod.mapHyperDispatch = mod.mapHyperTermDispatch;
|
||||
console.error('mapHyperTermDispatch is deprecated. Use mapHyperDispatch instead.');
|
||||
}
|
||||
|
||||
if (mod.middleware) {
|
||||
middlewares.push(mod.middleware);
|
||||
}
|
||||
|
|
@ -127,12 +139,12 @@ const loadModules = () => {
|
|||
connectors.Header.dispatch.push(mod.mapHeaderDispatch);
|
||||
}
|
||||
|
||||
if (mod.mapHyperTermState) {
|
||||
connectors.HyperTerm.state.push(mod.mapHyperTermState);
|
||||
if (mod.mapHyperState) {
|
||||
connectors.Hyper.state.push(mod.mapHyperState);
|
||||
}
|
||||
|
||||
if (mod.mapHyperTermDispatch) {
|
||||
connectors.HyperTerm.dispatch.push(mod.mapHyperTermDispatch);
|
||||
if (mod.mapHyperDispatch) {
|
||||
connectors.Hyper.dispatch.push(mod.mapHyperDispatch);
|
||||
}
|
||||
|
||||
if (mod.mapNotificationsState) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue