Merge branch 'master' of github.com:matildepark/urbit into matilde-chat-css

This commit is contained in:
Matilde Park 2019-08-02 11:38:25 -04:00
commit baa9f32c68
30 changed files with 471 additions and 3275 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8f6e93cb3ee5fcb0970851bd10d2d2a640ff968292d147c35385623b86570296
size 6662042
oid sha256:e0db2000c69c5e325413d3483183f2d87c810b9596ed68f0e5eb1755525668b8
size 6972895

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0e520b9ab0232d1765e1dacde96a1210845768e7334a334b5705d1c40348c82b
size 4464201
oid sha256:a8d28b096db251b3abffb2d96cf243274ba377e19d71dbfce87bb38d3cd88a9f
size 4609208

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5473058c09227359a1f41c1ac16b081dc1806c677b08b51ff653ec874c0521ff
size 9619972
oid sha256:210786877b2436c005e70f67ce929d3f56d624b4497f3476f3f0dcbadbcbb084
size 9692780

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,16 +1,14 @@
var gulp = require('gulp');
var cssimport = require('gulp-cssimport');
var rollup = require('gulp-better-rollup');
var cssnano = require('cssnano');
var postcss = require('gulp-postcss');
var sucrase = require('@sucrase/gulp-plugin');
var minify = require('gulp-minify');
var exec = require('child_process').exec;
var rename = require('gulp-rename');
var resolve = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');
var replace = require('rollup-plugin-replace');
var json = require('rollup-plugin-json');
var builtins = require('@joseph184/rollup-plugin-node-builtins');
var rootImport = require('rollup-plugin-root-import');
var globals = require('rollup-plugin-node-globals');
@ -25,9 +23,13 @@ var urbitrc = require('../urbitrc');
***/
gulp.task('css-bundle', function() {
let plugins = [
cssnano()
];
return gulp
.src('src/index.css')
.pipe(cssimport())
.pipe(postcss(plugins))
.pipe(gulp.dest('../../arvo/app/chat/css'));
});
@ -57,17 +59,12 @@ gulp.task('js-imports', function(cb) {
'node_modules/react-is/index.js': [ 'isValidElementType' ],
}
}),
replace({
'process.env.NODE_ENV': JSON.stringify('development')
}),
rootImport({
root: `${__dirname}/dist/js`,
useEntry: 'prepend',
extensions: '.js'
}),
json(),
globals(),
builtins(),
resolve()
]
}, 'umd'))
@ -93,9 +90,7 @@ gulp.task('tile-js-imports', function(cb) {
useEntry: 'prepend',
extensions: '.js'
}),
json(),
globals(),
builtins(),
resolve()
]
}, 'umd'))
@ -107,7 +102,6 @@ gulp.task('tile-js-imports', function(cb) {
.on('end', cb);
});
gulp.task('js-minify', function () {
return gulp.src('../../arvo/app/chat/js/index.js')
.pipe(minify())
@ -132,18 +126,6 @@ gulp.task('rename-tile-min', function() {
.pipe(gulp.dest('../../arvo/app/chat/js/'));
});
gulp.task('js-cachebust', function(cb) {
return Promise.resolve(
exec('git log', function (err, stdout, stderr) {
let firstLine = stdout.split("\n")[0];
let commitHash = firstLine.split(' ')[1].substr(0, 10);
let newFilename = "index-" + commitHash + "-min.js";
exec('mv ../../arvo/app/chat/js/index-min.js ../../arvo/app/chat/js/' + newFilename);
})
);
})
gulp.task('urbit-copy', function () {
let ret = gulp.src('../../arvo/**/*');

File diff suppressed because it is too large Load Diff

View File

@ -9,9 +9,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@joseph184/rollup-plugin-node-builtins": "^2.1.4",
"@sucrase/gulp-plugin": "^2.0.0",
"autoprefixer": "^9.6.1",
"cssnano": "^4.1.10",
"gulp": "^4.0.0",
"gulp-better-rollup": "^4.0.1",
@ -21,10 +19,8 @@
"gulp-rename": "^1.4.0",
"rollup": "^1.6.0",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-root-import": "^0.2.3",
"sucrase": "^3.8.0"
},
@ -32,11 +28,10 @@
"classnames": "^2.2.6",
"lodash": "^4.17.11",
"moment": "^2.20.1",
"mousetrap": "^1.6.1",
"mousetrap": "^1.6.3",
"react": "^16.5.2",
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.0",
"rollup-plugin-postcss": "^2.0.3",
"urbit-ob": "^3.1.1",
"urbit-sigil-js": "^1.3.2"
},

View File

@ -191,13 +191,29 @@ export class ChatScreen extends Component {
.slice(messages.length - (50 * state.numPages), messages.length);
}
let chatMessages = messages.reverse().map((msg) => {
let reversedMessages = messages.reverse();
let chatMessages = reversedMessages.map((msg, i) => {
// Render sigil if previous message is not by the same sender
let gamAut = ['gam', 'aut'];
let renderSigil =
_.get(reversedMessages[i + 1], gamAut) !== _.get(msg, gamAut);
// More padding top if previous message is not by the same sender
let paddingTop = renderSigil;
// More padding bot if next message is not by the same sender
let paddingBot =
_.get(reversedMessages[i - 1], gamAut) !== _.get(msg, gamAut);
return (
<Message
key={msg.gam.uid}
msg={msg.gam} />
msg={msg.gam}
renderSigil={renderSigil}
paddingTop={paddingTop}
paddingBot={paddingBot} />
);
});
let peers = props.peers[state.station] || [window.ship];
return (

View File

@ -27,8 +27,34 @@ export class LandingScreen extends Component {
}
onClickSubscribe() {
const { props } = this;
let station = props.match.params.ship + '/' + props.match.params.station;
this.props.api.source(station, true);
let actions = [
{
create: {
nom: 'hall-internal-' + props.match.params.station,
des: "chatroom",
sec: "channel"
}
},
{
source: {
nom: "inbox",
sub: true,
srs: [station]
}
},
{
source: {
nom: "inbox",
sub: true,
srs: [`~${window.ship}/hall-internal-${props.match.params.station}`]
}
}
];
this.props.api.chat(actions);
this.props.history.push('/~chat');
}
@ -50,7 +76,7 @@ export class LandingScreen extends Component {
<br />
<button
onClick={this.onClickSubscribe.bind(this)}
className="label-r"
className="label-regular fw-bold pointer"
>Subscribe</button>
</div>
</div>

View File

@ -6,11 +6,9 @@ export class Sigil extends Component {
render() {
const { props } = this;
console.log("sigil ship", props.ship);
if (props.ship.length > 14) {
return (
<div className="bg-black" style={{width: 32, height: 32}}>
<div className="bg-black" style={{width: 36, height: 36}}>
</div>
);
} else {

View File

@ -58,7 +58,7 @@ export class Message extends Component {
if (typeof url !== 'string') { throw 'Only transmogrify strings!'; }
const ship = window.ship;
if (url.indexOf('arvo://') === 0) {
return `http://${ship}.arvo.network` + url.split('arvo://')[1];
return url.split('arvo://')[1];
}
return url;
}
@ -66,32 +66,51 @@ export class Message extends Component {
render() {
const { props } = this;
let pending = !!props.msg.pending ? ' o-80' : '';
let timestamp = moment.unix(props.msg.wen / 1000).format('hh:mm');
let datestamp = moment.unix(props.msg.wen / 1000).format('LL');
return (
<div className={"w-100 pl3 pr3 pt2 pb2 cf flex" + pending}
style={{
minHeight: 'min-content'
}}>
<div className="fl mr2">
<Sigil ship={props.msg.aut} size={36} />
</div>
<div className="fr" style={{ flexGrow: 1, marginTop: -8 }}>
<div className="hide-child">
<p className="v-top label-small-mono gray dib mr3">
~{props.msg.aut}
</p>
<p className="v-top label-small-mono gray dib">{timestamp}</p>
<p className="v-top label-small-mono ml2 gray dib child">
{datestamp}
</p>
let paddingTop = props.paddingTop ? 'pt3' : '';
let paddingBot = props.paddingBot ? 'pb2' : 'pb1';
if (props.renderSigil) {
let timestamp = moment.unix(props.msg.wen / 1000).format('hh:mm a');
return (
<div className={"w-100 pl3 pr3 cf flex " + paddingTop + " " + paddingBot + pending}
style={{
minHeight: 'min-content'
}}>
<div className="fl mr2">
<Sigil ship={props.msg.aut} size={36} />
</div>
<div className="fr" style={{ flexGrow: 1, marginTop: -8 }}>
<div className="hide-child">
<p className="v-top label-small-mono gray dib mr3">
~{props.msg.aut}
</p>
<p className="v-top label-small-mono gray dib">{timestamp}</p>
<p className="v-top label-small-mono ml2 gray dib child">
{datestamp}
</p>
</div>
{this.renderContent()}
</div>
{this.renderContent()}
</div>
</div>
);
);
} else {
let timestamp = moment.unix(props.msg.wen / 1000).format('hh:mm');
return (
<div className={"w-100 pr3 pb1 cf hide-child flex" + pending}
style={{
minHeight: 'min-content'
}}>
<p className="child pl3 pr2 label-small-mono gray dib">{timestamp}</p>
<div className="fr" style={{ flexGrow: 1 }}>
{this.renderContent()}
</div>
</div>
)
}
}
}

View File

@ -127,7 +127,6 @@ class Clock extends Component {
}
render() {
console.log('hi')
return <div style={{position:'relative'}}>
<svg style={{position:'absolute'}} width="218" height="218" viewBox="0 0 234 234" fill="none" xmlns="http://www.w3.org/2000/svg">

View File

@ -2,18 +2,13 @@ var gulp = require('gulp');
var cssimport = require('gulp-cssimport');
var rollup = require('gulp-better-rollup');
var cssnano = require('cssnano');
var autoprefixer = require('autoprefixer');
var postcss = require('gulp-postcss')
var sucrase = require('@sucrase/gulp-plugin');
var minify = require('gulp-minify');
var exec = require('child_process').exec;
var rename = require('gulp-rename');
var resolve = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');
var replace = require('rollup-plugin-replace');
var json = require('rollup-plugin-json');
var builtins = require('@joseph184/rollup-plugin-node-builtins');
var rootImport = require('rollup-plugin-root-import');
var globals = require('rollup-plugin-node-globals');
@ -29,7 +24,6 @@ var urbitrc = require('../urbitrc');
gulp.task('css-bundle', function() {
let plugins = [
autoprefixer({ browsers: ['last 1 version'] }),
cssnano()
];
return gulp
@ -57,17 +51,12 @@ gulp.task('js-imports', function(cb) {
'node_modules/react-is/index.js': [ 'isValidElementType' ],
}
}),
replace({
'process.env.NODE_ENV': JSON.stringify('development')
}),
rootImport({
root: `${__dirname}/dist/js`,
useEntry: 'prepend',
extensions: '.js'
}),
json(),
globals(),
builtins(),
resolve()
]
}, 'umd'))
@ -91,18 +80,6 @@ gulp.task('rename-index-min', function() {
.pipe(gulp.dest('../../arvo/app/launch/js/'));
});
gulp.task('js-cachebust', function(cb) {
return Promise.resolve(
exec('git log', function (err, stdout, stderr) {
let firstLine = stdout.split("\n")[0];
let commitHash = firstLine.split(' ')[1].substr(0, 10);
let newFilename = "index-" + commitHash + "-min.js";
exec('mv ../../arvo/app/launch/js/index-min.js ../../arvo/app/launch/js/' + newFilename);
})
);
})
gulp.task('urbit-copy', function () {
let ret = gulp.src('../../arvo/**/*');

File diff suppressed because it is too large Load Diff

View File

@ -9,9 +9,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@joseph184/rollup-plugin-node-builtins": "^2.1.4",
"@sucrase/gulp-plugin": "^2.0.0",
"autoprefixer": "^9.6.1",
"cssnano": "^4.1.10",
"gulp": "^4.0.0",
"gulp-better-rollup": "^4.0.1",
@ -21,10 +19,8 @@
"gulp-rename": "^1.4.0",
"rollup": "^1.6.0",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-json": "^2.3.0",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-root-import": "^0.2.3",
"sucrase": "^3.8.0"
},
@ -32,9 +28,7 @@
"classnames": "^2.2.6",
"lodash": "^4.17.11",
"moment": "^2.20.1",
"mousetrap": "^1.6.1",
"react": "^16.5.2",
"react-custom-scrollbars": "^4.2.1",
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.0",
"urbit-ob": "^3.1.1"

View File

@ -2,18 +2,13 @@ var gulp = require('gulp');
var cssimport = require('gulp-cssimport');
var rollup = require('gulp-better-rollup');
var cssnano = require('cssnano');
var autoprefixer = require('autoprefixer');
var postcss = require('gulp-postcss')
var sucrase = require('@sucrase/gulp-plugin');
var minify = require('gulp-minify');
var exec = require('child_process').exec;
var rename = require('gulp-rename');
var resolve = require('rollup-plugin-node-resolve');
var commonjs = require('rollup-plugin-commonjs');
var replace = require('rollup-plugin-replace');
var json = require('rollup-plugin-json');
var builtins = require('@joseph184/rollup-plugin-node-builtins');
var rootImport = require('rollup-plugin-root-import');
var globals = require('rollup-plugin-node-globals');
@ -29,7 +24,6 @@ var urbitrc = require('../urbitrc');
gulp.task('css-bundle', function() {
let plugins = [
autoprefixer({ browsers: ['last 1 version'] }),
cssnano()
];
return gulp
@ -65,17 +59,12 @@ gulp.task('js-imports', function(cb) {
'node_modules/react-is/index.js': [ 'isValidElementType' ],
}
}),
replace({
'process.env.NODE_ENV': JSON.stringify('development')
}),
rootImport({
root: `${__dirname}/dist/js`,
useEntry: 'prepend',
extensions: '.js'
}),
json(),
globals(),
builtins(),
resolve()
]
}, 'umd'))
@ -101,9 +90,7 @@ gulp.task('tile-js-imports', function(cb) {
useEntry: 'prepend',
extensions: '.js'
}),
json(),
globals(),
builtins(),
resolve()
]
}, 'umd'))
@ -140,18 +127,6 @@ gulp.task('rename-tile-min', function() {
.pipe(gulp.dest('../../arvo/app/publish/js/'));
});
gulp.task('js-cachebust', function(cb) {
return Promise.resolve(
exec('git log', function (err, stdout, stderr) {
let firstLine = stdout.split("\n")[0];
let commitHash = firstLine.split(' ')[1].substr(0, 10);
let newFilename = "index-" + commitHash + "-min.js";
exec('mv ../../arvo/app/publish/js/index-min.js ../../arvo/app/publish/js/' + newFilename);
})
);
})
gulp.task('urbit-copy', function () {
let ret = gulp.src('../../arvo/**/*');

File diff suppressed because it is too large Load Diff

View File

@ -9,9 +9,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
"@joseph184/rollup-plugin-node-builtins": "^2.1.4",
"@sucrase/gulp-plugin": "^2.0.0",
"autoprefixer": "^9.6.1",
"cssnano": "^4.1.10",
"gulp": "^4.0.0",
"gulp-better-rollup": "^4.0.1",
@ -21,10 +19,8 @@
"gulp-rename": "^1.4.0",
"rollup": "^1.6.0",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-json": "^2.3.0",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-root-import": "^0.2.3",
"sucrase": "^3.8.0"
},
@ -32,9 +28,7 @@
"classnames": "^2.2.6",
"lodash": "^4.17.11",
"moment": "^2.20.1",
"mousetrap": "^1.6.1",
"react": "^16.5.2",
"react-custom-scrollbars": "^4.2.1",
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.0",
"urbit-ob": "^3.1.1",

View File

@ -8,8 +8,6 @@ export default class PublishTile extends Component {
}
render(){
console.log("tile", this.props);
let info = [];
if (this.props.data.invites > 0) {
let text = (this.props.data.invites == 1)

View File

@ -48,7 +48,7 @@ export default class WeatherTile extends Component {
renderWrapper(child) {
return (
<div className="pa2" style={{
<div className="pa2 relative" style={{
width: 234,
height: 234,
background: '#1a1a1a'
@ -60,9 +60,12 @@ export default class WeatherTile extends Component {
renderNoData() {
return this.renderWrapper((
<div>
<p className="white sans-serif">Weather</p>
<button onClick={this.locationSubmit.bind(this)}>Set location</button>
<div onClick={this.locationSubmit.bind(this)}>
<p className="gray label-regular b absolute"
style={{left: 8, top: 4}}>
Weather
</p>
<p className="absolute w-100 flex-col body-regular white" style={{verticalAlign: "bottom", bottom: 8, left: 8, cursor: "pointer"}}>-> Set location</p>
</div>
));
}
@ -75,12 +78,12 @@ export default class WeatherTile extends Component {
return this.renderWrapper((
<div>
<p className="gray" style={{
fontWeight: 'bold',
fontSize: 14,
lineHeight: '24px'
}}>Weather</p>
<div className="w-100 mb2 mt2">
<p className="gray label-regular b absolute"
style={{left: 8, top: 4}}>
Weather
</p>
<div className="w-100 mb2 mt2 absolute"
style={{left: 18, top: 28}}>
<img
src={'/~weather/img/' + c.icon + '.png'}
width={64}
@ -95,7 +98,8 @@ export default class WeatherTile extends Component {
}}>
{Math.round(c.temperature)}°</h2>
</div>
<div className="w-100 cf">
<div className="w-100 cf absolute"
style={{ left: 18, top: 118 }}>
<div className="fl w-50">
<IconWithData
icon='winddirection'

View File

@ -509,10 +509,10 @@ _stop_exit(c3_i int_i)
u3_daemon_bail();
}
/* _stop_trace(): print trace on SIGABRT.
/* _stop_signal(): handle termination signal.
*/
static void
_stop_trace(c3_i int_i)
_stop_signal(c3_i int_i)
{
// if we have a pier, unmap the event log before dumping core
//
@ -673,7 +673,7 @@ main(c3_i argc,
// Cleanup on SIGABRT.
//
signal(SIGABRT, _stop_trace);
signal(SIGABRT, _stop_signal);
printf("~\n");
// printf("welcome.\n");

View File

@ -750,6 +750,19 @@ _daemon_sign_init(void)
sig_u->nex_u = u3_Host.sig_u;
u3_Host.sig_u = sig_u;
}
// handle SIGQUIT (turn it into SIGABRT)
//
{
u3_usig* sig_u;
sig_u = c3_malloc(sizeof(u3_usig));
uv_signal_init(u3L, &sig_u->sil_u);
sig_u->num_i = SIGQUIT;
sig_u->nex_u = u3_Host.sig_u;
u3_Host.sig_u = sig_u;
}
}
/* _daemon_sign_cb: signal callback.
@ -778,6 +791,10 @@ _daemon_sign_cb(uv_signal_t* sil_u, c3_i num_i)
u3_term_ef_winc();
break;
}
case SIGQUIT: {
abort();
}
}
}
@ -866,6 +883,14 @@ u3_daemon_commence()
u3C.sign_hold_f = _daemon_sign_hold;
u3C.sign_move_f = _daemon_sign_move;
// Ignore SIGPIPE signals.
{
struct sigaction sig_s = {{0}};
sigemptyset(&(sig_s.sa_mask));
sig_s.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sig_s, 0);
}
// boot the ivory pill
//
{

View File

@ -496,7 +496,7 @@ static void
_pier_work_bail(void* vod_p,
const c3_c* err_c)
{
fprintf(stderr, "pier: work error: %s\r\n", err_c);
fprintf(stderr, "\rpier: work error: %s\r\n", err_c);
}
/* _pier_work_boot(): prepare for boot.
@ -838,11 +838,15 @@ _pier_work_exit(uv_process_t* req_u,
u3_controller* god_u = (void *) req_u;
u3_pier* pir_u = god_u->pir_u;
u3l_log("pier: exit: status %" PRIu64 ", signal %d\r\n", sas_i, sig_i);
fprintf(stderr, "\rpier: work exit: status %" PRId64 ", signal %d\r\n",
sas_i, sig_i);
uv_close((uv_handle_t*) req_u, 0);
u3_pier_db_shutdown(pir_u);
_pier_work_shutdown(pir_u);
// XX dispose
//
pir_u->god_u = 0;
u3_pier_bail();
}
/* _pier_work_poke(): handle subprocess result. transfer nouns.
@ -1803,10 +1807,12 @@ u3_pier_interrupt(u3_pier* pir_u)
static void
_pier_exit_done(u3_pier* pir_u)
{
u3l_log("pier: exit\r\n");
u3_pier_db_shutdown(pir_u);
_pier_work_shutdown(pir_u);
if ( 0 != pir_u->god_u ) {
_pier_work_shutdown(pir_u);
}
_pier_loop_exit(pir_u);
// XX uninstall pier from u3K.tab_u, dispose

View File

@ -898,6 +898,15 @@ main(c3_i argc, c3_c* argv[])
u3C.slog_f = _worker_send_slog;
}
// Ignore SIGPIPE signals.
//
{
struct sigaction sig_s = {{0}};
sigemptyset(&(sig_s.sa_mask));
sig_s.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sig_s, 0);
}
/* configure pipe to daemon process
*/
{