Merge branch 'master' into chat-message-types

This commit is contained in:
Fang 2019-08-02 21:20:01 +02:00
commit 905092aa0a
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
43 changed files with 681 additions and 3338 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:a4a8e1daf0bfe86d5fc4ef7060b0c6a6c2678a344787926f14bb4b8cfabe8752
size 9549390
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

View File

@ -1019,6 +1019,8 @@
==
::
$listen-api !!
$export !!
$import !!
$as
:* %as mar.source.com
$(num +(num), source.com next.source.com)

View File

@ -92,6 +92,7 @@
++ lime :: diff fruit
$% {$hall-prize prize} ::
{$hall-rumor rumor} ::
{$export [%hall-v0 (list telegram)]} :: sent to lens
== ::
++ pear :: poke fruit
$% {$hall-command command} ::
@ -2789,6 +2790,8 @@
^- (list move)
=+ mur=(~(get by res) p)
?^ mur u.mur
?: =([%export ~] p)
~
=- =. res (~(put by res) p -)
-
=+ qer=(path-to-query p)
@ -3017,6 +3020,10 @@
|= pax/path
^- (quip move _+>)
?: ?=([%sole *] pax) ~&(%hall-no-sole !!)
?: ?=([%export *] pax)
:_ +>.$
[ost.bol %diff %export [%hall-v0 grams:(~(got by stories) ~.inbox)]]~
::
=+ qer=(path-to-query pax)
?. (leak src.bol qer) ~&(%peer-invisible !!)
=^ mos +>.$
@ -3196,6 +3203,20 @@
:- ~
+>.$(log (~(del by log) nom))
::
++ poke-import
|= i=*
^- (quip move _+>)
::
?> ?=([%hall-v0 *] i)
=/ grams=(list telegram) ;;((list telegram) +.i)
::
~& [%importing-telegrams count=(lent grams)]
::
%- pre-bake
%+ turn grams
|= t/telegram
[%story ~.inbox %gram [our.bol ~.inbox] t]
::
++ log-all-to-file
:: update stories logs
::

View File

@ -1,5 +1,5 @@
/- lens
/+ *server
/+ *server, base64
/= lens-mark /: /===/mar/lens/command
/!noun/
=, format
@ -12,6 +12,7 @@
+$ card
$% [%connect wire binding:eyre term]
[%http-response =http-event:http]
[%peer wire dock path]
[%peel wire dock mark path]
[%poke wire dock poke]
[%pull wire dock ~]
@ -19,6 +20,7 @@
::
+$ poke
$% [%lens-command command:lens]
[%import *]
==
::
+$ state
@ -49,6 +51,7 @@
%- (require-authorization:app ost.bow move this)
|= =inbound-request:eyre
^- (quip move _this)
::
?^ job.state
:_ this
[ost.bow %http-response %start [%500 ~] ~ %.y]~
@ -60,6 +63,22 @@
(need (de-json:html q:(need body.request.inbound-request)))
=/ com=command:lens
(json:grab:lens-mark jon)
::
?: ?=(%export -.source.com)
~& [%export app.source.com]
:_ this(job.state (some [ost.bow com]))
[ost.bow %peer /export [our.bow app.source.com] /export]~
::
?: ?=(%import -.source.com)
?~ enc=(de:base64 base64-jam.source.com)
:_ this
[ost.bow %http-response %start [%500 ~] ~ %.y]~
::
=/ c=* (cue q.u.enc)
::
:_ this(job.state (some [ost.bow com]))
[ost.bow %poke /import [our.bow app.source.com] %import c]~
::
:_ this(job.state (some [ost.bow com]))
[ost.bow %peel /sole [our.bow %dojo] %lens-json /sole]~
::
@ -72,6 +91,29 @@
:_ this(job.state ~)
[bone.u.job.state %http-response (json-response:app (json-to-octs jon))]~
::
++ diff-export
|= [=wire data=*]
^- (quip move _this)
::
?> ?=(^ job.state)
:: herb will do whatever we tell it to, so by convention have it write to an
:: app name based on the file name.
::
?> ?=(%export -.source.com.u.job.state)
=/ app-name=tape (trip app.source.com.u.job.state)
=/ output=@t (crip "/{app-name}/jam")
::
=/ jon=json
=/ =atom (jam data)
=/ =octs [(met 3 atom) atom]
=/ enc (en:base64 octs)
(pairs:enjs:format file+s+output data+s+enc ~)
::
:_ this(job.state ~)
:~ [bone.u.job.state %http-response (json-response:app (json-to-octs jon))]
[ost.bow %pull /export [our.bow app.source.com.u.job.state] ~]
==
::
++ quit
|= =wire
^- (quip move _this)
@ -81,6 +123,10 @@
++ reap
|= [=wire saw=(unit tang)]
^- (quip move _this)
::
?: =([%export ~] wire)
[~ this]
::
?^ saw
[((slog u.saw) ~) this]
?> ?=(^ job.state)
@ -92,6 +138,19 @@
++ coup
|= [=wire saw=(unit tang)]
^- (quip move _this)
::
?: =([%import ~] wire)
?> ?=(^ job.state)
:_ this(job.state ~)
:_ ~
:* bone.u.job.state
%http-response
%start
[%200 ~]
[~ (as-octt:mimes:html "\"Imported data\"")]
%.y
==
::
?^ saw
[((slog u.saw) ~) this]
[~ this]

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

@ -66,9 +66,9 @@
== ::
++ work :: interface action
$% :: circle management ::
{$join (map circle range)} :: subscribe to
{$join (map circle range) (unit char)} :: subscribe to
{$leave audience} :: unsubscribe from
{$create security name cord} :: create circle
{$create security name cord (unit char)} :: create circle
{$delete name (unit cord)} :: delete circle
{$depict name cord} :: change description
{$filter name ? ?} :: change message rules
@ -838,14 +838,14 @@
::
;~((glue ace) (perk %read ~) cire dem:ag)
::
;~((glue ace) (perk %join ~) sorz)
;~((glue ace) (perk %join ~) ;~(plug sorz (punt ;~(pfix ace glyph))))
::
;~((glue ace) (perk %leave ~) cirs)
::
;~ (glue ace) (perk %create ~)
pore
cire
qut
;~(plug qut (punt ;~(pfix ace glyph)))
==
::
;~ plug (perk %delete ~)
@ -1186,9 +1186,11 @@
:: change local mailbox config to include
:: subscriptions to {pas}.
::
|= pos/(map circle range)
|= {pos/(map circle range) gyf/(unit char)}
^+ ..sh-work
=+ pas=~(key by pos)
=? ..sh-work ?=(^ gyf)
(bind u.gyf `pas)
=. ..sh-work
sh-prod(active.she pas)
:: default to a day of backlog
@ -1226,11 +1228,11 @@
::
:: creates circle {nom} with specified config.
::
|= {sec/security nom/name txt/cord}
|= {sec/security nom/name txt/cord gyf/(unit char)}
^+ ..sh-work
=. ..sh-work
(sh-act %create nom txt sec)
(join [[[self nom] ~] ~ ~])
(join [[[self nom] ~] ~ ~] gyf)
::
++ delete
:: %delete
@ -1922,7 +1924,7 @@
$(dif [%filter fit.cof.dif])
?: ?=($remove -.dif)
(sh-note (weld "rip " (~(cr-show cr cir) ~)))
?: ?=($usage -.dif) +>
?: ?=(?($usage $read) -.dif) +>
%- sh-note
%+ weld
(weld ~(cr-phat cr cir) ": ")
@ -1933,9 +1935,6 @@
::
$caption
"cap: {(trip cap.dif)}"
::
$read
""
::
$filter
;: weld

File diff suppressed because one or more lines are too long

View File

@ -35,6 +35,8 @@
;~(pfix col (more net (cook crip (star ;~(less net prn)))))
==
listen-api+(su ;~(plug sym ;~(pfix col sym)))
export+so
import+(ot app+so base64-jam+so ~)
as+(ot mark+(su sym) next+source ~)
hoon+(ot code+so next+source ~)
==

View File

@ -15,6 +15,8 @@
{$hoon code/@t next/source} :: end since they
{$tuple next/(list source)} :: don't bunt well
{$listen-api api/term event/term}
{$export app/@t}
{$import app/@t base64-jam/@t}
==
++ sink
$% {$stdout ~}

View File

@ -101,8 +101,11 @@
++ wake
|= error=(unit tang)
^+ [moves state]
:: no-op on spurious but innocuous unix wakeups
::
?~ timers.state ~| %behn-wake-no-timer^error !!
?~ timers.state
~? ?=(^ error) %behn-wake-no-timer^u.error
[moves state]
:: if we errored, pop the timer and notify the client vane of the error
::
?^ error
@ -111,7 +114,6 @@
:: if unix woke us too early, retry by resetting the unix wakeup timer
::
?: (gth date.i.timers.state now)
~? debug=%.n [%behn-wake-too-soon `@dr`(sub date.i.timers.state now)]
set-unix-wake(next-wake.state ~)
:: pop first timer, tell vane it has elapsed, and adjust next unix wakeup
::
@ -197,7 +199,6 @@
:: ignore duplicates
::
?: =(t i.timers)
~? debug=%.n [%behn-set-duplicate t]
timers
:: timers at the same date form a fifo queue
::
@ -214,7 +215,6 @@
:: if we don't have this timer, no-op
::
?~ timers
~? debug=%.n [%behn-unset-missing t]
~
?: =(i.timers t)
t.timers
@ -260,11 +260,10 @@
:: +load: migrate an old state to a new behn version
::
++ load
|= old=*
|= old=behn-state
^+ behn-gate
::
~| %behn-load-fail
behn-gate(state (behn-state old))
behn-gate(state old)
:: +scry: view timer state
::
:: TODO: not referentially transparent w.r.t. elapsed timers,

View File

@ -802,7 +802,7 @@
::
:_ state
:_ ~
:^ duct %pass /run-app/[app.act]
:^ duct %pass /run-app-request/[app.act]
^- note
:^ %g %deal [our our]
::
@ -847,7 +847,7 @@
%app
:_ state
:_ ~
:^ duct %pass /run-app/[app.action]
:^ duct %pass /run-app-request/[app.action]
^- note
:^ %g %deal [our our]
:: todo: i don't entirely understand gall; there's a way to make a gall
@ -892,12 +892,9 @@
%app
:_ state
:_ ~
:^ duct %pass /run-app/[app.action.u.connection]
:^ duct %pass /run-app-cancel/[app.action.u.connection]
^- note
:^ %g %deal [our our]
:: todo: i don't entirely understand gall; there's a way to make a gall
:: use a %handle arm instead of a sub-%poke with the
:: %handle-http-request type.
::
^- cush:gall
:* app.action.u.connection
@ -2029,13 +2026,14 @@
?+ i.wire
~|([%bad-take-wire wire] !!)
::
%run-app run-app
%run-build run-build
%channel channel
%acme acme-ack
%run-app-request run-app-request
%run-app-cancel run-app-cancel
%run-build run-build
%channel channel
%acme acme-ack
==
::
++ run-app
++ run-app-request
::
?> ?=([%g %unto *] sign)
::
@ -2060,6 +2058,18 @@
=^ moves server-state.ax (handle-response http-event.p.sign)
[moves http-server-gate]
::
++ run-app-cancel
::
?> ?=([%g %unto *] sign)
::
:: we explicitly don't care about the return value of a
:: %handle-http-cancel. It is purely a notification and we don't care if
:: it succeeds or not. The user might not have implemented
:: +poke-handle-http-cancel or it might have crashed, but since it's a
:: notification, we don't don't care about its return value.
::
[~ http-server-gate]
::
++ run-build
::
?> ?=([%f %made *] sign)

View File

@ -272,7 +272,7 @@
(expect-eq !>(~[/http-blah]) !>(duct))
::
%+ expect-gall-deal
:+ /run-app/app1 [~nul ~nul]
:+ /run-app-request/app1 [~nul ~nul]
^- cush:gall
:* %app1 %poke %handle-http-request
!>([%.n %.n [%ipv4 .192.168.1.1] [%'GET' '/' ~ ~]])
@ -287,7 +287,7 @@
now=~1111.1.4
scry=scry-provides-code
^= take-args
:* wire=/run-app/app1 duct=~[/http-blah]
:* wire=/run-app-request/app1 duct=~[/http-blah]
^- (hypo sign:http-server-gate)
:- *type
:* %g %unto %http-response
@ -359,7 +359,7 @@
(expect-eq !>(~[/http-blah]) !>(duct))
::
%+ expect-gall-deal
:+ /run-app/app1 [~nul ~nul]
:+ /run-app-request/app1 [~nul ~nul]
^- cush:gall
:* %app1 %poke %handle-http-request
!>([%.n %.n [%ipv4 .192.168.1.1] [%'GET' '/' ~ ~]])
@ -374,7 +374,7 @@
now=~1111.1.4
scry=scry-provides-code
^= take-args
:* wire=/run-app/app1 duct=~[/http-blah]
:* wire=/run-app-request/app1 duct=~[/http-blah]
^- (hypo sign:http-server-gate)
:- *type
:* %g %unto %coup ~
@ -449,7 +449,7 @@
(expect-eq !>(~[/http-blah]) !>(duct))
::
%+ expect-gall-deal
:+ /run-app/app1 [~nul ~nul]
:+ /run-app-request/app1 [~nul ~nul]
^- cush:gall
:* %app1 %poke %handle-http-request
!>([%.n %.n [%ipv4 .192.168.1.1] [%'GET' '/' ~ ~]])
@ -464,7 +464,7 @@
now=~1111.1.4
scry=scry-provides-code
^= take-args
:* wire=/run-app/app1 duct=~[/http-blah]
:* wire=/run-app-request/app1 duct=~[/http-blah]
^- (hypo sign:http-server-gate) :- *type
:* %g %unto %http-response
%start
@ -485,7 +485,7 @@
now=~1111.1.4
scry=scry-provides-code
^= take-args
:* wire=/run-app/app1 duct=~[/http-blah]
:* wire=/run-app-request/app1 duct=~[/http-blah]
^- (hypo sign:http-server-gate) :- *type
:* %g %unto %http-response
[%continue [~ (as-octs:mimes:html 'ya!')] %.y]
@ -556,7 +556,7 @@
(expect-eq !>(~[/http-blah]) !>(duct))
::
%+ expect-gall-deal
:+ /run-app/app1 [~nul ~nul]
:+ /run-app-request/app1 [~nul ~nul]
^- cush:gall
:* %app1 %poke %handle-http-request
!>([%.n %.n [%ipv4 .192.168.1.1] [%'GET' '/~landscape/inner-path' ~ ~]])
@ -571,7 +571,7 @@
now=~1111.1.4
scry=scry-provides-code
^= take-args
:* wire=/run-app/app1 duct=~[/http-blah]
:* wire=/run-app-request/app1 duct=~[/http-blah]
^- (hypo sign:http-server-gate) :- *type
:* %g %unto %http-response
[%start [307 ['location' '/~/login?redirect=/~landscape/inner-path']~] ~ %.y]
@ -624,7 +624,7 @@
:: expect authenticated=%.y in the handle below
::
%+ expect-gall-deal
:+ /run-app/app1 [~nul ~nul]
:+ /run-app-request/app1 [~nul ~nul]
^- cush:gall
:* %app1 %poke %handle-http-request
!> :*
@ -1814,7 +1814,7 @@
(expect-eq !>(~[/http-blah]) !>(duct))
::
%+ expect-gall-deal
:+ /run-app/app1 [~nul ~nul]
:+ /run-app-request/app1 [~nul ~nul]
^- cush:gall
:* %app1 %poke %handle-http-request
!>([%.n %.n [%ipv4 .192.168.1.1] [%'GET' '/' ~ ~]])
@ -1848,19 +1848,38 @@
(expect-eq !>(~[/http-blah]) !>(duct))
::
%+ expect-gall-deal
:+ /run-app/app1 [~nul ~nul]
:+ /run-app-cancel/app1 [~nul ~nul]
^- cush:gall
:* %app1 %poke %handle-http-cancel
!>([%.n %.n [%ipv4 .192.168.1.1] [%'GET' '/' ~ ~]])
==
card
==
:: app1 doesn't have a %handle-http-cancel arm, but that's fine and doesn't
:: crash eyre when it sends its error coup back because we take no action on
:: the response to handle-http-cancel.
::
=^ results5 http-server-gate
%- http-server-take :*
http-server-gate
now=~1111.1.4
scry=scry-provides-code
^= take-args
:* wire=/run-app-cancel/app1 duct=~[/http-blah]
^- (hypo sign:http-server-gate) :- *type
:* %g %unto %coup
`[[%leaf "error! error! error!"] ~]
==
==
expected-move=~
==
::
;: weld
results1
results2
results3
results4
results5
==
::
++ http-server-call

View File

@ -113,6 +113,33 @@ class sourceAction(argparse.Action):
else:
return {self.which: new_value}
class importFileAction(argparse.Action):
"""Handles the import statement.
The --import statement reads in a jammed noun file from the current working
directory and stuffs it the base64 encoded version which gets passed into
your Urbit.
"""
def __call__(self, parser, res, new_value, option_string):
logging.debug('%r %r' % (new_value, option_string))
logging.debug('source %s' % res.source)
logging.debug('level %s' % res.level)
# We check to see if there's a "{new_value}.jam" file in the current
# working directory. If there isn't, we error
data = ""
filename = new_value + ".jam"
with open(filename, 'rb') as f:
data = f.read()
if data == "":
raise ValueError('Failed to read jamfile')
base_data = base64.b64encode(data)
res.source = {"import": {"app": new_value, "base64-jam": base_data}}
class transformerAction(argparse.Action):
"""Handle transformer flag.
@ -310,6 +337,14 @@ parser.add_argument('-l', '--listen-api', which='listen-api',
metavar='api:event',
help='listen to event from api',
action=sourceAction)
parser.add_argument('-e', '--export', which='export',
metavar='app-name',
help='exports the application state',
action=sourceAction)
parser.add_argument('-i', '--import',
metavar='app-name',
help='imports the application state',
action=importFileAction)
parser.add_argument('-m', '--mark', which='as',
metavar='mark',
help='transform a source to another mark',

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

@ -8,7 +8,7 @@ export class Sigil extends Component {
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

@ -162,32 +162,50 @@ 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 clamp-message" style={{ flexGrow: 1, marginTop: -8 }}>
<div className="hide-child">
<p className="v-top label-small-mono gray dib mr3">
{this.renderAuthor()}
</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">
{this.renderAuthor()}
</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

@ -337,6 +337,7 @@
c3_c* dns_c; // domain XX multiple/fallback
c3_w imp_w[256]; // imperial IPs
time_t imp_t[256]; // imperial IP timestamps
c3_o imp_o[256]; // imperial print status
} u3_ames;
/* u3_save: checkpoint control.

View File

@ -122,11 +122,19 @@ _ames_czar_gone(u3_pact* pac_u, time_t now)
u3_pier* pir_u = u3_pier_stub();
u3_ames* sam_u = pir_u->sam_u;
u3l_log("ames: czar at %s: not found (b)\n", pac_u->dns_c);
if ( c3y == sam_u->imp_o[pac_u->imp_y] ) {
u3l_log("ames: czar at %s: not found (b)\n", pac_u->dns_c);
sam_u->imp_o[pac_u->imp_y] = c3n;
}
if ( (0 == sam_u->imp_w[pac_u->imp_y]) ||
(0xffffffff == sam_u->imp_w[pac_u->imp_y]) ) {
(0xffffffff == sam_u->imp_w[pac_u->imp_y]) )
{
sam_u->imp_w[pac_u->imp_y] = 0xffffffff;
} /* else keep existing ip for 5 more minutes */
}
// keep existing ip for 5 more minutes
//
sam_u->imp_t[pac_u->imp_y] = now;
_ames_pact_free(pac_u);
@ -136,8 +144,8 @@ _ames_czar_gone(u3_pact* pac_u, time_t now)
*/
static void
_ames_czar_cb(uv_getaddrinfo_t* adr_u,
c3_i sas_i,
struct addrinfo* aif_u)
c3_i sas_i,
struct addrinfo* aif_u)
{
// XX revisit
u3_pier* pir_u = u3_pier_stub();
@ -160,6 +168,7 @@ _ames_czar_cb(uv_getaddrinfo_t* adr_u,
sam_u->imp_w[pac_u->imp_y] = ntohl(add_u->sin_addr.s_addr);
sam_u->imp_t[pac_u->imp_y] = now;
sam_u->imp_o[pac_u->imp_y] = c3y;
#if 1
if ( sam_u->imp_w[pac_u->imp_y] != old_w
@ -309,6 +318,12 @@ u3_ames_ef_send(u3_pier* pir_u, u3_noun lan, u3_noun pac)
return;
}
if ( c3n == sam_u->liv ) {
u3l_log("ames: not yet live, dropping outbound\r\n");
u3z(lan); u3z(pac);
return;
}
u3_pact* pac_u = c3_calloc(sizeof(*pac_u));
if ( c3y == _ames_lane_ip(lan, &pac_u->por_s, &pac_u->pip_w) ) {

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
*/
{