git ssb

16+

Dominic / patchbay



Commit 4f38a991eff961ff071507e747fd5dba7a2a5e94

Merge branch 'master' of github.com:ssbc/patchbay into npm-dependency-updates

Christian Bundy committed on 10/19/2018, 7:43:06 PM
Parent: c5835557d006a50602b898335246296708f5138a
Parent: 2ed843ec43ce4c8195cf646b049ce93812ab2a5e

Files changed

about/html/avatar.jschanged
about/html/avatar.mcsschanged
about/pull/updates.jsadded
app/html/modal.mcsschanged
app/html/scroller.jschanged
app/html/search-bar.jschanged
app/page/blob.mcsschanged
app/page/notifications.jschanged
app/page/query.jschanged
app/page/thread.jschanged
app/page/thread.mcsschanged
app/styles/mcss/button.mcsschanged
app/styles/mcss/marama.jschanged
app/styles/mcss/markdown.mcsschanged
main.jschanged
message/html/compose.jschanged
message/html/compose.mcsschanged
message/html/confirm.jschanged
message/html/decorate/data-root.jschanged
message/html/layout/default.mcsschanged
message/html/layout/mini.jschanged
message/html/layout/mini.mcsschanged
package-lock.jsonchanged
package.jsonchanged
router/async/normalise.jschanged
router/sync/routes.jschanged
about/html/avatar.jsView
@@ -13,17 +13,20 @@
1313
1414 exports.create = function (api) {
1515 return nest('about.html.avatar', avatar)
1616
17- function avatar (id) {
17 + function avatar (id, size = 4) {
1818 const src = api.about.obs.imageUrl(id)
1919 const color = computed(src, src => src.match(/^http/) ? 'rgba(0,0,0,0)' : api.about.obs.color(id))
2020
21- return api.about.html.link(id,
21 + const avatar = api.about.html.link(id,
2222 h('img', {
23- className: 'Avatar',
2423 style: { 'background-color': color },
2524 src
2625 })
2726 )
27 + avatar.classList.add('Avatar')
28 + avatar.style.setProperty('--avatar-size', isNaN(size) ? size : `${size}rem`)
29 +
30 + return avatar
2831 }
2932 }
about/html/avatar.mcssView
@@ -1,6 +1,13 @@
11 Avatar {
2- width: 4rem
3- height: 4rem
2 + --avatar-size: 4rem
43
4 + width: var(--avatar-size)
5 + height: var(--avatar-size)
6 +
57 transition: background-color .15s ease-out
8 +
9 + img {
10 + width: var(--avatar-size)
11 + height: var(--avatar-size)
12 + }
613 }
about/pull/updates.jsView
@@ -1,0 +1,65 @@
1 +const nest = require('depnest')
2 +const pull = require('pull-stream')
3 +const Notify = require('pull-notify')
4 +const { isMsg, isFeed } = require('ssb-ref')
5 +
6 +exports.gives = nest('about.pull.updates')
7 +
8 +exports.needs = nest({
9 + 'keys.sync.id': 'first',
10 + 'message.obs.likes': 'first',
11 + 'sbot.pull.stream': 'first'
12 +})
13 +
14 +exports.create = (api) => {
15 + const cache = {}
16 + var listening = false
17 +
18 + return nest('about.pull.updates', updates)
19 +
20 + function updates (key) {
21 + if (!(isMsg(key) || isFeed(key))) throw new Error(`about.pull.updates expects a valid message/ feed key, got ${key}`)
22 + startListening()
23 +
24 + if (!cache[key]) cache[key] = Notify()
25 + return cache[key].listen()
26 + }
27 +
28 + function startListening () {
29 + if (listening) return
30 +
31 + const opts = {
32 + live: true,
33 + old: false,
34 + query: [{
35 + $filter: {
36 + value: {
37 + timestamp: { $gt: 0 },
38 + content: {
39 + type: 'about',
40 + about: { $truthy: true }
41 + }
42 + }
43 + }
44 + }, {
45 + $map: {
46 + about: ['value', 'content', 'about']
47 + }
48 + }]
49 + }
50 + pull(
51 + api.sbot.pull.stream(server => server.query.read(opts)),
52 + pull.filter(m => !m.sync),
53 + pull.drain(
54 + ({ about }) => {
55 + if (!cache[about]) return
56 +
57 + cache[about](1) // emit a minimal update!
58 + },
59 + (err) => console.error(err)
60 + )
61 + )
62 +
63 + listening = true
64 + }
65 +}
app/html/modal.mcssView
@@ -1,29 +1,32 @@
11 Modal {
2- display: flex
3- flex-direction: row
42 position: fixed
5- z-index: 90
6-
73 top: var(--app-border-width)
84 bottom: var(--app-border-width)
95 left: var(--app-border-width)
106 right: var(--app-border-width)
7 + z-index: 90
8 +
119 background: rgba(15, 0, 25, 0.78)
1210
11 + display: grid
12 + justify-content: center
13 + align-content: center
14 +
1315 div.content {
1416 max-width: 90vw
1517 max-height: 90vh
1618 overflow: auto
1719
1820 $backgroundPrimary
1921 box-shadow: rgba(0,0,0,.34) 2px 6px 10px
20- margin: auto
22 + margin: calc(var(--app-border-width) + 2.3rem) auto var(--app-border-width) auto
23 + /* 2.3rem is height of Hypertabs > nav */
2124 $dontSelect
2225 }
2326
2427 -open {
25- display: flex
28 + display: grid
2629 }
2730
2831 -close {
2932 display: none
app/html/scroller.jsView
@@ -6,18 +6,18 @@
66 exports.create = function (api) {
77 return nest('app.html.scroller', Scroller)
88
99 function Scroller (opts = {}) {
10- const { prepend = [], content = null, append = [], classList = [], className = '', title = '' } = opts
10 + const { prepend, content = null, append, classList = [], className = '', title = '' } = opts
1111
1212 const contentSection = h('section.content', { title: '' }, content)
1313
1414 const container = h('Scroller',
1515 { classList, className, title, style: { 'overflow-y': 'scroll', 'overflow-x': 'auto' } },
1616 [
17- h('section.top', prepend),
17 + prepend ? h('section.top', prepend) : null,
1818 contentSection,
19- h('section.bottom', append)
19 + append ? h('section.bottom', append) : null
2020 ]
2121 )
2222
2323 container.scroll = keyscroll(contentSection)
@@ -46,13 +46,14 @@
4646 }
4747 }
4848
4949 return function scroll (d) {
50- selectChild((!curMsgEl || d === 'first') ? content.firstChild
50 + const child = (!curMsgEl || d === 'first') ? content.firstChild
5151 : (!curMsgEl || d === 'last') ? content.lastChild
5252 : d < 0 ? curMsgEl.previousElementSibling || content.firstChild
5353 : d > 0 ? curMsgEl.nextElementSibling || content.lastChild
54- : curMsgEl)
54 + : curMsgEl
55 + selectChild(child)
5556
5657 return curMsgEl
5758 }
5859
app/html/search-bar.jsView
@@ -67,15 +67,15 @@
6767
6868 if (char === '@') api.about.async.suggest(word, cb)
6969 if (char === '#') api.channel.async.suggest(word, cb)
7070 if (char === '/') cb(null, getPagesSuggestions(word))
71- }, {cls: 'PatchSuggest'})
71 + }, { cls: 'PatchSuggest' })
7272
7373 // TODO extract
7474 function getPagesSuggestions (word) {
7575 const pages = [
7676 'blogs', 'calendar', 'posts', 'public', 'private', 'inbox', 'profile', 'notifications', 'settings',
77- 'gatherings', 'chess', 'books', 'imageSearch', 'polls', 'query', 'dark-crystal', 'postRank'
77 + 'gatherings', 'chess', 'books', 'imageSearch', 'polls', 'query', 'dark-crystal', 'postRank', 'scry/new'
7878 ]
7979
8080 return pages
8181 .filter(page => ~page.indexOf(word))
app/page/blob.mcssView
@@ -1,13 +1,18 @@
11 Blob {
2- position: relative
32 width: 100%
43 height: 100%
54
5 + display: grid
6 + grid: 1fr / 1fr
7 + align-items: stretch
8 + justify-items: stretch
9 +
610 iframe {
7- position: absolute
8- width: 100%
9- height: 100%
1011 border: 0
12 +
13 + /* don't think these work */
14 + object-fit: scale-down
15 + object-position: 50% 50%
1116 }
1217 }
1318
app/page/notifications.jsView
@@ -39,15 +39,15 @@
3939 function draw () {
4040 resetFeed({ container, content })
4141
4242 pull(
43- pullMentions({old: false, live: true}),
43 + pullMentions({ old: false, live: true }),
4444 filterDownThrough(),
4545 Scroller(container, content, api.message.html.render, true, false)
4646 )
4747
4848 pull(
49- pullMentions({reverse: true, live: false}),
49 + pullMentions({ reverse: true, live: false }),
5050 filterUpThrough(),
5151 Scroller(container, content, api.message.html.render, false, false)
5252 )
5353 }
@@ -56,17 +56,24 @@
5656 container.title = '/notifications'
5757 return container
5858 }
5959
60- // NOTE - this currently hits mentions AND the patchwork message replies
60 + // NOTE - currently this stream is know to pick up:
61 + // - post mentions (public)
62 + // - patchwork replies (public)
63 + // - scry (public, private)
64 +
6165 function pullMentions (opts) {
6266 const query = [{
6367 $filter: {
6468 dest: api.keys.sync.id(),
65- timestamp: {$gt: 0},
69 + timestamp: { $gt: 0 }
70 + }
71 + }, {
72 + $filter: {
6673 value: {
67- author: {$ne: api.keys.sync.id()}, // not my messages!
68- private: {$ne: true} // not private mentions
74 + author: { $ne: api.keys.sync.id() } // not my messages!
75 + // NOTE putting this in second filter might be necessary to stop index trying to use this author value
6976 }
7077 }
7178 }]
7279
@@ -78,8 +85,12 @@
7885
7986 return api.sbot.pull.stream(server => {
8087 return pull(
8188 next(server.backlinks.read, _opts, ['timestamp']),
89 + pull.filter(m => {
90 + if (m.value.content.type !== 'post') return true
91 + return !m.value.private // no private posts
92 + }),
8293 pull.filter(m => !api.message.sync.isBlocked(m))
8394 )
8495 })
8596 }
app/page/query.jsView
@@ -3,8 +3,9 @@
33 const Scroller = require('mutant-scroll')
44 const next = require('pull-next-query')
55 const json5 = require('json5')
66 const get = require('lodash/get')
7 +const isEqual = require('lodash/isEqual')
78
89 exports.gives = nest({
910 'app.html.menuItem': true,
1011 'app.page.query': true
@@ -43,9 +44,12 @@
4344 } catch (err) {
4445 // console.error(err)
4546 return err
4647 }
47- if (isValidOpts(newOpts)) state.opts.set(newOpts)
48 + // NOTE - this is the piece which auto-runs the quers
49 + if (!isValidOpts(newOpts)) return
50 + if (isEqual(resolve(state.opts), newOpts)) return
51 + state.opts.set(newOpts)
4852 })
4953
5054 const activateQuery = () => state.opts.set(json5.parse(resolve(state.input)))
5155
@@ -66,8 +70,9 @@
6670 comparer: (a, b) => {
6771 if (a && b && a.key && b.key) return a.key === b.key
6872 return a === b
6973 }
74 + // cb: console.error // TODO better error catching with stream
7075 })
7176 })
7277 ])
7378 ])
@@ -212,9 +217,9 @@
212217
213218 // regex lifted from ssb-ref
214219 var arr = chunk.split(/((?:@|%|&)[A-Za-z0-9/+]{43}=\.[\w\d]+)/g)
215220 for (var i = 1; i < arr.length; i += 2) {
216- arr[i] = h('a', {href: arr[i]}, arr[i])
221 + arr[i] = h('a', { href: arr[i] }, arr[i])
217222 }
218223 newArray = [...newArray, ...arr]
219224 })
220225
app/page/thread.jsView
@@ -22,9 +22,9 @@
2222 exports.create = function (api) {
2323 return nest('app.page.thread', threadPage)
2424
2525 function threadPage (location) {
26- const root = get(location, 'value.content.root', location.key)
26 + const root = get(location, 'value.content.root') || get(location, 'value.content.about') || location.key
2727 const msg = location.key
2828 if (msg !== root) scrollDownToMessage(msg)
2929
3030 const { messages, isPrivate, rootId, lastId, channel, recps } = api.feed.obs.thread(root)
app/page/thread.mcssView
@@ -1,7 +1,7 @@
11 Thread {
22 section.top {
3- border-bottom: solid 1px gainsboro
3 + /* border-bottom: solid 1px gainsboro */
44
55 section.recipients {
66 display: flex
77 justify-content: center
app/styles/mcss/button.mcssView
@@ -37,16 +37,14 @@
3737 }
3838
3939 :disabled {
4040 color: grey
41- background: #fff
41 + background: rgba(255,255,255,.3)
42 + cursor: not-allowed
43 + border: none
4244
43- cursor: initial
44-
4545 :hover {
46- color: grey
47- background: #fff
48- border: 1px #b9b9b9 solid
46 + background: rgba(255,0,0,.3)
4947 }
5048 }
5149
5250 -subtle {
app/styles/mcss/marama.jsView
@@ -1,11 +1,11 @@
11 const nest = require('depnest')
2-const { assign } = Object
32 const getMCSS = require('marama/lib/get-mcss')
43
54 exports.gives = nest('styles.mcss')
65
76 exports.create = function (api) {
87 return nest('styles.mcss', (sofar = {}) => {
9- return assign(sofar, { marama: getMCSS() })
8 + sofar.marama = getMCSS()
9 + return sofar
1010 })
1111 }
app/styles/mcss/markdown.mcssView
@@ -2,8 +2,11 @@
22 p, ul, ol {
33 }
44
55 p {
6 + :first-of-type { margin-top: 0 }
7 + :last-of-type { margin-bottom: 0 }
8 +
69 a {
710 img { margin 0 .5rem }
811
912 :only-of-type {
@@ -77,9 +80,18 @@
7780 vertical-align: middle
7881 margin-top: -0.2em
7982 }
8083
84 + (p) {
85 + img.emoji {
86 + :only-child {
87 + width: 3rem
88 + height: 3rem
89 + }
90 + }
91 + }
8192
93 +
8294 h1, h2, h3, h4, h5, h6 {
8395 margin: 0
8496 }
8597 h1, h2 {
main.jsView
@@ -38,9 +38,9 @@
3838 const sockets = combine(
3939 require('patchbay-scry'),
4040 require('patchbay-dark-crystal'),
4141 require('patchbay-poll'),
42- require('ssb-chess'),
42 + require('ssb-chess-mithril'),
4343 require('patchbay-gatherings'),
4444 require('patchbay-book'),
4545 patchbay,
4646 require('patchcore'),
message/html/compose.jsView
@@ -1,23 +1,25 @@
1-const { h, when, send, resolve, Value, computed } = require('mutant')
1 +const { h, when, send, resolve, Value, Array: MutantArray, computed } = require('mutant')
22 const nest = require('depnest')
33 const ssbMentions = require('ssb-mentions')
44 const extend = require('xtend')
55 const addSuggest = require('suggest-box')
6 +const blobFiles = require('ssb-blob-files')
7 +const get = require('lodash/get')
68
79 exports.gives = nest('message.html.compose')
810
911 exports.needs = nest({
1012 'about.async.suggest': 'first',
1113 'channel.async.suggest': 'first',
1214 'emoji.async.suggest': 'first',
1315 'meme.async.suggest': 'first',
14- 'blob.html.input': 'first',
1516 'message.html.confirm': 'first',
1617 'drafts.sync.get': 'first',
1718 'drafts.sync.set': 'first',
1819 'drafts.sync.remove': 'first',
19- 'settings.obs.get': 'first'
20 + 'settings.obs.get': 'first',
21 + 'sbot.obs.connection': 'first'
2022 })
2123
2224 exports.create = function (api) {
2325 return nest({ 'message.html.compose': compose })
@@ -80,8 +82,17 @@
8082 clearTimeout(blurTimeout)
8183 blurTimeout = setTimeout(() => textAreaFocused.set(false), 200)
8284 },
8385 'ev-focus': send(textAreaFocused.set, true),
86 + 'ev-paste': ev => {
87 + const files = get(ev, 'clipboardData.files')
88 + if (!files || !files.length) return
89 + const opts = {
90 + stripExif: api.settings.obs.get('patchbay.removeExif', true),
91 + isPrivate
92 + }
93 + blobFiles(files, api.sbot.obs.connection, opts, afterBlobed)
94 + },
8495 placeholder
8596 })
8697 textArea.publish = publish // TODO: fix - clunky api for the keyboard shortcut to target
8798
@@ -92,46 +103,60 @@
92103 hasContent.set(true)
93104 }
94105
95106 var isPrivate = location.page === 'private' ||
96- (location.key && !location.value) ||
97- (location.value && location.value.private)
107 + (location.key && !location.value) ||
108 + (location.value && location.value.private)
98109
99- var warningMessage = Value(null)
100- var warning = h('section.warning',
101- { className: when(warningMessage, '-open', '-closed') },
102- [
103- h('div.warning', warningMessage),
104- h('div.close', { 'ev-click': () => warningMessage.set(null) }, 'x')
105- ]
106- )
107- var fileInput = api.blob.html.input(file => {
108- const megabytes = file.size / 1024 / 1024
109- if (megabytes >= 5) {
110- const rounded = Math.floor(megabytes * 100) / 100
111- warningMessage.set([
110 + var warningMessages = MutantArray([])
111 + var warning = computed(warningMessages, msgs => {
112 + if (!msgs.length) return
113 +
114 + return h('section.warnings', msgs.map((m, i) => {
115 + return h('div.warning', [
112116 h('i.fa.fa-exclamation-triangle'),
113- h('strong', file.name),
114- ` is ${rounded}MB - the current limit is 5MB`
117 + h('div.message', m),
118 + h('i.fa.fa-times', { 'ev-click': () => warningMessages.deleteAt(i) })
115119 ])
120 + }))
121 + })
122 +
123 + var fileInput = h('input', {
124 + type: 'file',
125 + // accept,
126 + attributes: { multiple: true },
127 + 'ev-click': () => hasContent.set(true),
128 + 'ev-change': (ev) => {
129 + warningMessages.set([])
130 +
131 + const files = ev.target.files
132 + const opts = {
133 + stripExif: api.settings.obs.get('patchbay.removeExif', true),
134 + isPrivate
135 + }
136 + blobFiles(files, api.sbot.obs.connection, opts, afterBlobed)
137 + }
138 + })
139 + function afterBlobed (err, result) {
140 + if (err) {
141 + console.error(err)
142 + warningMessages.push(err.message)
116143 return
117144 }
118145
119- files.push(file)
120- filesById[file.link] = file
146 + files.push(result)
147 + filesById[result.link] = result
121148
122149 const pos = textArea.selectionStart
123- const embed = file.type.match(/^image/) ? '!' : ''
150 + const embed = result.type.match(/^image/) ? '!' : ''
124151 const spacer = embed ? '\n' : ' '
125- const insertLink = spacer + embed + '[' + file.name + ']' + '(' + file.link + ')' + spacer
152 + const insertLink = spacer + embed + '[' + result.name + ']' + '(' + result.link + ')' + spacer
126153
127154 textArea.value = textArea.value.slice(0, pos) + insertLink + textArea.value.slice(pos)
128155
129- console.log('added:', file)
130- }, { private: isPrivate, removeExif: api.settings.obs.get('patchbay.removeExif', true) })
156 + console.log('added:', result)
157 + }
131158
132- fileInput.onclick = () => hasContent.set(true)
133-
134159 var publishBtn = h('button', { 'ev-click': publish }, isPrivate ? 'Reply' : 'Publish')
135160
136161 var actions = h('section.actions', [
137162 fileInput,
@@ -164,9 +189,9 @@
164189 addSuggest(channelInput, (inputText, cb) => {
165190 if (inputText[0] === '#') {
166191 api.channel.async.suggest(inputText.slice(1), cb)
167192 }
168- }, {cls: 'PatchSuggest'})
193 + }, { cls: 'PatchSuggest' })
169194 channelInput.addEventListener('suggestselect', ev => {
170195 channelInput.value = ev.detail.id // HACK : this over-rides the markdown value
171196 })
172197
@@ -177,9 +202,9 @@
177202 if (char === '@') api.about.async.suggest(wordFragment, feedIdsInThread, cb)
178203 if (char === '#') api.channel.async.suggest(wordFragment, cb)
179204 if (char === ':') api.emoji.async.suggest(wordFragment, cb)
180205 if (char === '&') api.meme.async.suggest(wordFragment, cb)
181- }, {cls: 'PatchSuggest'})
206 + }, { cls: 'PatchSuggest' })
182207
183208 return composer
184209
185210 // scoped
message/html/compose.mcssView
@@ -26,32 +26,30 @@
2626 cursor: not-allowed
2727 }
2828 }
2929
30- section.warning {
30 + section.warnings {
3131 color: #fff
32- background-color: red
3332
34- height: 0
35- padding: 0 .5rem
36- transition: all ease-in .1s
33 + div.warning {
34 + background-color: red
35 + padding: .5rem
36 + margin-bottom: 5px
3737
38- display: flex
39- justify-content: space-between
38 + display: flex
39 + justify-content: start
40 + align-items: center
4041
42 + i.fa-exclamation-triangle { margin-right: .5rem }
4143
42- -open {
43- padding: .5rem
44- height: initial
45- }
44 + div.message {
45 + flex-grow: 1
46 + font-weight: 600
47 + margin-right: .3rem
48 + }
4649
47- i.fa { margin-right: .5rem }
48- div.warning {
49- strong { margin-right: .3rem }
50 + i.fa-times { cursor: pointer }
5051 }
51- div.close {
52- cursor: pointer
53- }
5452 }
5553
5654 section.actions {
5755 display: flex
message/html/confirm.jsView
@@ -38,19 +38,17 @@
3838 var okay = h('button.okay', {
3939 'ev-click': () => {
4040 lb.remove()
4141 api.message.async.publish(content, cb)
42- }},
43- 'okay'
44- )
42 + }
43 + }, 'okay')
4544
4645 var cancel = h('button.cancel.-subtle', {
4746 'ev-click': () => {
4847 lb.remove()
4948 cb(null)
50- }},
51- 'cancel'
52- )
49 + }
50 + }, 'cancel')
5351
5452 okay.addEventListener('keydown', (ev) => {
5553 if (ev.keyCode === 27) cancel.click() // escape
5654 })
message/html/decorate/data-root.jsView
@@ -4,7 +4,8 @@
44
55 exports.create = (api) => {
66 return nest('message.html.decorate', function (element, { msg }) {
77 if (msg.value.content.root) element.dataset.root = msg.value.content.root
8 + if (msg.value.content.about) element.dataset.root = msg.value.content.about
89 return element
910 })
1011 }
message/html/layout/default.mcssView
@@ -2,8 +2,9 @@
22 padding: 1rem .5rem
33
44 display: grid
55 grid-template-columns: 5rem auto
6 + grid-row-gap: .5rem
67
78 section.avatar {
89 grid-column: 1 / 2
910 grid-row: 1 / span 4
@@ -45,10 +46,8 @@
4546 section.content {
4647 grid-column: 2 / 3
4748 grid-row: 2 / span 1
4849
49- margin-bottom: .5rem
50-
5150 (img) {
5251 max-width: 100%
5352 }
5453 (video) {
message/html/layout/mini.jsView
@@ -1,12 +1,13 @@
11 const nest = require('depnest')
22 const { h, Value } = require('mutant')
33
4-exports.needs = nest('message.html', {
5- backlinks: 'first',
6- author: 'first',
7- meta: 'map',
8- timestamp: 'first'
4 +exports.needs = nest({
5 + 'app.sync.goTo': 'first',
6 + 'message.html.backlinks': 'first',
7 + 'message.html.author': 'first',
8 + 'message.html.meta': 'map',
9 + 'message.html.timestamp': 'first'
910 })
1011
1112 exports.gives = nest('message.html.layout')
1213
@@ -25,9 +26,9 @@
2526 }, [
2627 h('section.timestamp', {}, api.message.html.timestamp(msg)),
2728 h('header.author', {}, api.message.html.author(msg, { size: 'mini' })),
2829 h('section.meta', {}, api.message.html.meta(msg, { rawMessage })),
29- h('section.content', {}, opts.content),
30 + h('section.content', { 'ev-click': () => api.app.sync.goTo(msg) }, opts.content),
3031 h('section.raw-content', rawMessage)
3132 ])
3233 }
3334 }
message/html/layout/mini.mcssView
@@ -4,8 +4,9 @@
44 padding: .25rem .5rem
55 min-height: inherit
66
77 display: flex
8 + flex-wrap: wrap
89
910 /* TODO - bring style inline with default.mcss */
1011
1112 section.timestamp {
@@ -29,8 +30,9 @@
2930 order: 2
3031 flex-basis: initial
3132 flex-grow: 1
3233
34 + cursor: pointer
3335 margin-top: 0
3436 }
3537
3638 section.meta {
@@ -48,6 +50,23 @@
4850
4951 section.raw-content {
5052 order: 4
5153 margin-left: 0
54 +
55 + pre {
56 + border: 1px gainsboro solid
57 + padding: .8rem
58 + background-color: #f5f5f5
59 + color: #c121dc
60 + padding: .3rem
61 + white-space: pre-wrap
62 + word-wrap: break-word
63 +
64 + span {
65 + font-weight: 600
66 + }
67 + a {
68 + word-break: break-all
69 + }
70 + }
5271 }
5372 }
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 360896 bytes
New file size: 397617 bytes
package.jsonView
@@ -1,7 +1,7 @@
11 {
22 "name": "patchbay",
3- "version": "7.14.0",
3 + "version": "7.15.0",
44 "description": "patchbay 2, built on patchcore",
55 "main": "index.js",
66 "scripts": {
77 "lint": "standard --fix",
@@ -65,19 +65,20 @@
6565 "open-external": "^0.1.1",
6666 "patch-context": "^2.0.1",
6767 "patch-drafts": "0.0.6",
6868 "patch-history": "^1.0.0",
69- "patch-inbox": "^1.1.8",
69 + "patch-inbox": "^1.1.9",
7070 "patch-settings": "^1.1.2",
7171 "patch-suggest": "^2.0.2",
7272 "patchbay-book": "^1.0.8",
73- "patchbay-dark-crystal": "^1.0.3",
74- "patchbay-gatherings": "^2.0.2",
75- "patchbay-poll": "^1.0.9",
76- "patchbay-scry": "^1.1.1",
73 + "patchbay-dark-crystal": "^1.0.5",
74 + "patchbay-gatherings": "^3.2.1",
75 + "patchbay-poll": "^1.1.1",
76 + "patchbay-scry": "^1.2.0",
7777 "patchcore": "^1.28.1",
7878 "pull-abortable": "^4.1.1",
7979 "pull-next-query": "^1.0.0",
80 + "pull-notify": "^0.1.1",
8081 "pull-scroll": "^1.0.9",
8182 "pull-stream": "^3.6.9",
8283 "read-directory": "^3.0.0",
8384 "require-style": "^1.0.1",
@@ -86,11 +87,12 @@
8687 "scuttlebot": "^12.1.0",
8788 "setimmediate": "^1.0.5",
8889 "ssb-about": "^0.1.2",
8990 "ssb-backlinks": "^0.7.3",
91 + "ssb-blob-files": "^1.1.1",
9092 "ssb-blobs": "^1.1.5",
91- "ssb-chess": "^2.3.13",
92- "ssb-chess-db": "^1.0.3",
93 + "ssb-chess-db": "^1.0.4",
94 + "ssb-chess-mithril": "1.0.6",
9395 "ssb-config": "^2.3.0",
9496 "ssb-ebt": "^5.2.3",
9597 "ssb-friends": "^3.1.3",
9698 "ssb-keys": "^7.0.15",
@@ -98,9 +100,9 @@
98100 "ssb-mentions": "^0.5.0",
99101 "ssb-mutual": "^0.1.0",
100102 "ssb-private": "^0.2.3",
101103 "ssb-query": "^2.1.0",
102- "ssb-ref": "^2.11.1",
104 + "ssb-ref": "^2.12.0",
103105 "ssb-search": "^1.1.2",
104106 "ssb-sort": "^1.1.0",
105107 "ssb-unread": "^1.0.1",
106108 "ssb-ws": "^2.1.1",
router/async/normalise.jsView
@@ -1,6 +1,6 @@
11 const nest = require('depnest')
2-const { isBlob, isFeed, isMsg } = require('ssb-ref')
2 +const { isBlobLink, isFeed, isMsg } = require('ssb-ref')
33
44 exports.gives = nest('router.async.normalise')
55
66 exports.needs = nest({
@@ -26,13 +26,16 @@
2626 api.sbot.async.get(location, (err, value) => {
2727 if (err) cb(err)
2828 else {
2929 if (typeof value.content === 'string') value = api.message.sync.unbox(value)
30- cb(null, {key: location, value})
30 + cb(null, { key: location, value })
3131 }
3232 })
33- } else if (isBlob(location)) cb(null, { blob: location })
34- else if (isChannel(location)) cb(null, { channel: location })
33 + } else if (isBlobLink(location)) {
34 + // handles public & private blobs
35 + // TODO - parse into link and query?
36 + cb(null, { blob: location })
37 + } else if (isChannel(location)) cb(null, { channel: location })
3538 else if (isFeed(location)) cb(null, { feed: location })
3639 else if (isPage(location)) cb(null, { page: location.substring(1) })
3740
3841 return true
router/sync/routes.jsView
@@ -1,6 +1,6 @@
11 const nest = require('depnest')
2-const { isBlob, isFeed, isMsg } = require('ssb-ref')
2 +const { isBlobLink, isFeed, isMsg } = require('ssb-ref')
33
44 exports.gives = nest('router.sync.routes')
55
66 exports.needs = nest({
@@ -45,9 +45,9 @@
4545 [ loc => loc.page === 'query', pages.query ],
4646 [ loc => loc.page === 'search' && loc.query, pages.search ],
4747 [ loc => loc.page === 'settings', pages.settings ],
4848
49- [ loc => isBlob(loc.blob), pages.blob ],
49 + [ loc => loc.blob && isBlobLink(loc.blob), pages.blob ],
5050 [ loc => isPresent(loc.channel), pages.channel ],
5151 [ loc => isFeed(loc.feed), pages.profile ],
5252 [ loc => isMsg(loc.key), pages.thread ]
5353 ]

Built with git-ssb-web