From 993ba2d00f2ff9f3189082b93f2a0e2c43a6dedd Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Wed, 12 Aug 2020 12:10:27 +1000 Subject: [PATCH 01/30] glob: update to 0v2.pbthv.gd1q2.h2ura.5esrn.d361c --- bin/solid.pill | 4 ++-- pkg/arvo/app/glob.hoon | 2 +- pkg/arvo/app/landscape/index.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/solid.pill b/bin/solid.pill index ad04bed3c..02e11e82a 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ef417c3092dc32d6d5897a7ba63f3f8910f928f0aa23adf3a356b88ce027a415 -size 6260173 +oid sha256:6cd7246753c12c7acb757e1a6ee54c177806c20a137ad8fb4300c000ac146a0f +size 6260139 diff --git a/pkg/arvo/app/glob.hoon b/pkg/arvo/app/glob.hoon index 846fe5b6e..f19d51515 100644 --- a/pkg/arvo/app/glob.hoon +++ b/pkg/arvo/app/glob.hoon @@ -1,7 +1,7 @@ /- glob /+ default-agent, verb, dbug |% -++ hash 0v7.foe2o.ang8k.28dnr.fudi0.74c8d +++ hash 0v2.pbthv.gd1q2.h2ura.5esrn.d361c +$ state-0 [%0 hash=@uv glob=(unit (each glob:glob tid=@ta))] +$ all-states $% state-0 diff --git a/pkg/arvo/app/landscape/index.html b/pkg/arvo/app/landscape/index.html index 4dd8b6a23..93841346b 100644 --- a/pkg/arvo/app/landscape/index.html +++ b/pkg/arvo/app/landscape/index.html @@ -23,7 +23,7 @@
- + From b0d252fa7633ba030c555f690594d85c0d59b36f Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Wed, 12 Aug 2020 21:12:05 -0400 Subject: [PATCH 02/30] publish: no-op when joining our own notebook Fixes #3300. --- pkg/arvo/app/publish.hoon | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/arvo/app/publish.hoon b/pkg/arvo/app/publish.hoon index 17470e7e5..2ed386584 100644 --- a/pkg/arvo/app/publish.hoon +++ b/pkg/arvo/app/publish.hoon @@ -1831,6 +1831,8 @@ :: %subscribe ?> (team:title our.bol src.bol) + ?: =(our.bol who.act) + [~ state] =/ join-wire=wire /join-group/[(scot %p who.act)]/[book.act] =/ meta=(unit (set path)) From 058ec8aa2c340c253deff882d28dad4150351bac Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Wed, 12 Aug 2020 14:02:15 -0700 Subject: [PATCH 03/30] chat: serialize %keys to JSON for chat update --- pkg/arvo/lib/chat-store.hoon | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/lib/chat-store.hoon b/pkg/arvo/lib/chat-store.hoon index 1ef713879..df5d98264 100644 --- a/pkg/arvo/lib/chat-store.hoon +++ b/pkg/arvo/lib/chat-store.hoon @@ -93,7 +93,11 @@ [%create (pairs [%path (path path.upd)]~)] ?: ?=(%delete -.upd) [%delete (pairs [%path (path path.upd)]~)] - [*@t *json] + ?> ?=(%keys -.upd) + :- %keys + :- %a + %+ turn ~(tap by keys.upd) + |= pax=^path (path pax) == -- ++ dejs From 04326ad04d2c1d150a5e76a5da04e9e12cef5368 Mon Sep 17 00:00:00 2001 From: Caio Marcelo de Oliveira Filho Date: Thu, 13 Aug 2020 01:05:05 -0700 Subject: [PATCH 04/30] chat: Refactor to use ?- in chat update JSON serialization --- pkg/arvo/lib/chat-store.hoon | 61 ++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/pkg/arvo/lib/chat-store.hoon b/pkg/arvo/lib/chat-store.hoon index df5d98264..3b40c6c05 100644 --- a/pkg/arvo/lib/chat-store.hoon +++ b/pkg/arvo/lib/chat-store.hoon @@ -61,8 +61,9 @@ ^- json %+ frond %chat-update %- pairs - :~ - ?: ?=(%initial -.upd) + :_ ~ + ?- -.upd + %initial :- %initial %- pairs %+ turn ~(tap by inbox.upd) @@ -73,31 +74,37 @@ :~ [%envelopes [%a (turn envelopes.mailbox envelope)]] [%config (config config.mailbox)] == - ?: ?=(%message -.upd) - :- %message - %- pairs - :~ [%path (path path.upd)] - [%envelope (envelope envelope.upd)] - == - ?: ?=(%messages -.upd) - :- %messages - %- pairs - :~ [%path (path path.upd)] - [%start (numb start.upd)] - [%end (numb end.upd)] - [%envelopes [%a (turn envelopes.upd envelope)]] - == - ?: ?=(%read -.upd) - [%read (pairs [%path (path path.upd)]~)] - ?: ?=(%create -.upd) - [%create (pairs [%path (path path.upd)]~)] - ?: ?=(%delete -.upd) - [%delete (pairs [%path (path path.upd)]~)] - ?> ?=(%keys -.upd) - :- %keys - :- %a - %+ turn ~(tap by keys.upd) - |= pax=^path (path pax) + :: + %message + :- %message + %- pairs + :~ [%path (path path.upd)] + [%envelope (envelope envelope.upd)] + == + :: + %messages + :- %messages + %- pairs + :~ [%path (path path.upd)] + [%start (numb start.upd)] + [%end (numb end.upd)] + [%envelopes [%a (turn envelopes.upd envelope)]] + == + :: + %read + [%read (pairs [%path (path path.upd)]~)] + :: + %create + [%create (pairs [%path (path path.upd)]~)] + :: + %delete + [%delete (pairs [%path (path path.upd)]~)] + :: + %keys + :- %keys + :- %a + %+ turn ~(tap by keys.upd) + |= pax=^path (path pax) == -- ++ dejs From 31eb49174dc121facf95884ec94eccdd2f246be2 Mon Sep 17 00:00:00 2001 From: Tyler Brown Cifu Shuster Date: Fri, 14 Aug 2020 13:39:37 -0700 Subject: [PATCH 05/30] interface: makes embed button a button --- .../views/apps/chat/components/lib/content/url.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/interface/src/views/apps/chat/components/lib/content/url.js b/pkg/interface/src/views/apps/chat/components/lib/content/url.js index 21fb6dff1..a6f1f989a 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/content/url.js +++ b/pkg/interface/src/views/apps/chat/components/lib/content/url.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import { Button } from '@tlon/indigo-react'; const IMAGE_REGEX = new RegExp(/(jpg|img|png|gif|tiff|jpeg|webp|webm|svg)$/i); @@ -79,11 +80,14 @@ export default class UrlContent extends Component { > {content.url} - this.unfoldEmbed()} + {contents}
); From d8ead05309a59525bf87e5a9659ac91e2ab92f86 Mon Sep 17 00:00:00 2001 From: Tyler Brown Cifu Shuster Date: Fri, 14 Aug 2020 15:04:38 -0700 Subject: [PATCH 06/30] interface: adds absolute path resolution to imports --- pkg/interface/.babelrc | 14 ++++++++++ pkg/interface/package-lock.json | 15 +++++++++++ pkg/interface/package.json | 1 + pkg/interface/src/logic/api/base.ts | 2 +- pkg/interface/src/logic/api/chat.ts | 4 +-- pkg/interface/src/logic/api/contacts.ts | 6 ++--- pkg/interface/src/logic/api/global.ts | 2 +- pkg/interface/src/logic/api/groups.ts | 4 +-- pkg/interface/src/logic/api/invite.ts | 2 +- pkg/interface/src/logic/api/links.ts | 2 +- pkg/interface/src/logic/api/metadata.ts | 2 +- pkg/interface/src/logic/api/publish.ts | 6 ++--- pkg/interface/src/logic/lib/group.ts | 4 +-- .../src/logic/reducers/chat-update.ts | 6 ++--- .../src/logic/reducers/connection.ts | 2 +- .../src/logic/reducers/contact-update.ts | 4 +-- .../src/logic/reducers/group-update.ts | 6 ++--- .../src/logic/reducers/invite-update.ts | 4 +-- .../src/logic/reducers/launch-update.ts | 4 +-- .../src/logic/reducers/link-update.ts | 2 +- .../src/logic/reducers/listen-update.ts | 4 +-- pkg/interface/src/logic/reducers/local.ts | 4 +-- .../src/logic/reducers/metadata-update.ts | 4 +-- .../src/logic/reducers/permission-update.ts | 4 +-- .../src/logic/reducers/publish-response.ts | 2 +- .../src/logic/reducers/publish-update.ts | 6 ++--- pkg/interface/src/logic/reducers/s3-update.ts | 4 +-- pkg/interface/src/logic/store/store.ts | 2 +- pkg/interface/src/logic/store/type.ts | 26 +++++++++---------- pkg/interface/src/logic/subscription/base.ts | 2 +- .../src/logic/subscription/global.ts | 2 +- pkg/interface/src/views/App.js | 10 +++---- pkg/interface/src/views/apps/chat/app.tsx | 10 +++---- .../src/views/apps/chat/components/chat.tsx | 18 ++++++------- .../src/views/apps/chat/components/join.js | 2 +- .../apps/chat/components/lib/chat-header.js | 4 +-- .../apps/chat/components/lib/chat-input.js | 4 +-- .../components/lib/chat-scroll-container.js | 2 +- .../chat/components/lib/groupify-button.js | 4 +-- .../chat/components/lib/invite-element.js | 4 +-- .../views/apps/chat/components/lib/message.js | 2 +- .../chat/components/lib/metadata-color.js | 2 +- .../chat/components/lib/metadata-settings.js | 2 +- .../apps/chat/components/lib/overlay-sigil.js | 2 +- .../chat/components/lib/profile-overlay.js | 4 +-- .../apps/chat/components/lib/s3-upload.js | 2 +- .../src/views/apps/chat/components/new-dm.js | 6 ++--- .../src/views/apps/chat/components/new.js | 6 ++--- .../views/apps/chat/components/settings.js | 6 ++--- .../src/views/apps/chat/components/sidebar.js | 4 +-- .../views/apps/chat/components/skeleton.js | 2 +- .../src/views/apps/dojo/components/input.js | 4 +-- pkg/interface/src/views/apps/groups/app.tsx | 8 +++--- .../src/views/apps/groups/components/join.js | 2 +- .../groups/components/lib/add-contact.tsx | 10 +++---- .../groups/components/lib/contact-card.js | 6 ++--- .../groups/components/lib/contact-item.js | 4 +-- .../groups/components/lib/contact-sidebar.tsx | 16 ++++++------ .../groups/components/lib/group-detail.js | 10 +++---- .../groups/components/lib/group-sidebar.js | 6 ++--- .../apps/groups/components/lib/s3-upload.js | 2 +- .../src/views/apps/groups/components/new.tsx | 14 +++++----- .../views/apps/groups/components/skeleton.js | 2 +- .../apps/launch/components/tiles/basic.js | 2 +- pkg/interface/src/views/apps/links/app.js | 2 +- .../links/components/lib/channel-sidebar.js | 4 +-- .../links/components/lib/channels-item.js | 2 +- .../apps/links/components/lib/comment-item.js | 4 +-- .../components/lib/comments-pagination.js | 2 +- .../apps/links/components/lib/comments.js | 2 +- .../links/components/lib/invite-element.js | 4 +-- .../components/lib/link-detail-preview.js | 2 +- .../apps/links/components/lib/link-item.js | 4 +-- .../apps/links/components/lib/link-submit.js | 2 +- .../apps/links/components/lib/links-tabbar.js | 2 +- .../links/components/lib/member-element.js | 4 +-- .../apps/links/components/lib/pagination.js | 2 +- .../src/views/apps/links/components/link.js | 6 ++--- .../views/apps/links/components/links-list.js | 4 +-- .../src/views/apps/links/components/member.js | 6 ++--- .../src/views/apps/links/components/new.js | 6 ++--- .../views/apps/links/components/settings.js | 6 ++--- .../views/apps/links/components/skeleton.js | 2 +- .../publish/components/lib/comment-item.js | 4 +-- .../apps/publish/components/lib/comments.js | 4 +-- .../apps/publish/components/lib/edit-post.js | 6 ++--- .../views/apps/publish/components/lib/join.js | 2 +- .../apps/publish/components/lib/new-post.js | 6 ++--- .../views/apps/publish/components/lib/new.js | 6 ++--- .../views/apps/publish/components/lib/note.js | 6 ++--- .../publish/components/lib/notebook-posts.js | 2 +- .../apps/publish/components/lib/notebook.js | 6 ++--- .../apps/publish/components/lib/settings.js | 6 ++--- .../apps/publish/components/lib/sidebar.js | 4 +-- .../publish/components/lib/subscribers.js | 4 +-- .../views/apps/publish/components/skeleton.js | 2 +- pkg/interface/src/views/components/Group.tsx | 12 ++++----- .../src/views/components/InviteSearch.tsx | 10 +++---- pkg/interface/src/views/components/Omnibox.js | 4 +-- .../src/views/components/OmniboxResult.js | 2 +- .../src/views/components/SidebarInvite.tsx | 2 +- 101 files changed, 259 insertions(+), 229 deletions(-) create mode 100644 pkg/interface/.babelrc diff --git a/pkg/interface/.babelrc b/pkg/interface/.babelrc new file mode 100644 index 000000000..79bef5613 --- /dev/null +++ b/pkg/interface/.babelrc @@ -0,0 +1,14 @@ +{ + "plugins": [ + [ + "babel-plugin-root-import", + { + "paths": [ + { + "rootPathSuffix": "./src" + } + ] + } + ] + ] +} \ No newline at end of file diff --git a/pkg/interface/package-lock.json b/pkg/interface/package-lock.json index c3f717ee9..876bcf0cc 100644 --- a/pkg/interface/package-lock.json +++ b/pkg/interface/package-lock.json @@ -2362,6 +2362,15 @@ "object.assign": "^4.1.0" } }, + "babel-plugin-root-import": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-root-import/-/babel-plugin-root-import-6.5.0.tgz", + "integrity": "sha512-PTD8fPl4v1kwn01u9d4rgRavDs5Z+jv4qa4/y6iYtoSgM4/xmjwMqo66j5A/BTZQEMA6OV5iFgyZ1PIhroJqqg==", + "dev": true, + "requires": { + "slash": "^3.0.0" + } + }, "babel-plugin-styled-components": { "version": "1.10.7", "resolved": "https://registry.npmjs.org/babel-plugin-styled-components/-/babel-plugin-styled-components-1.10.7.tgz", @@ -8420,6 +8429,12 @@ "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, "slice-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", diff --git a/pkg/interface/package.json b/pkg/interface/package.json index 338828766..6f062f7cf 100644 --- a/pkg/interface/package.json +++ b/pkg/interface/package.json @@ -50,6 +50,7 @@ "@typescript-eslint/parser": "^3.8.0", "babel-eslint": "^10.1.0", "babel-loader": "^8.1.0", + "babel-plugin-root-import": "^6.5.0", "clean-webpack-plugin": "^3.0.0", "cross-env": "^7.0.2", "eslint": "^6.8.0", diff --git a/pkg/interface/src/logic/api/base.ts b/pkg/interface/src/logic/api/base.ts index 322e4b4c7..b18a34516 100644 --- a/pkg/interface/src/logic/api/base.ts +++ b/pkg/interface/src/logic/api/base.ts @@ -1,6 +1,6 @@ import _ from "lodash"; import { uuid } from "../lib/util"; -import { Patp, Path } from "../types/noun"; +import { Patp, Path } from "~/types/noun"; import BaseStore from '../store/base'; export default class BaseApi { diff --git a/pkg/interface/src/logic/api/chat.ts b/pkg/interface/src/logic/api/chat.ts index 3e5f98960..bd16529cf 100644 --- a/pkg/interface/src/logic/api/chat.ts +++ b/pkg/interface/src/logic/api/chat.ts @@ -1,7 +1,7 @@ import BaseApi from './base'; import { uuid } from '../lib/util'; -import { Letter, ChatAction, Envelope } from '../types/chat-update'; -import { Patp, Path, PatpNoSig } from '../types/noun'; +import { Letter, ChatAction, Envelope } from '~/types/chat-update'; +import { Patp, Path, PatpNoSig } from '~/types/noun'; import { StoreState } from '../store/type'; import BaseStore from '../store/base'; diff --git a/pkg/interface/src/logic/api/contacts.ts b/pkg/interface/src/logic/api/contacts.ts index 066a0a534..27f8faf25 100644 --- a/pkg/interface/src/logic/api/contacts.ts +++ b/pkg/interface/src/logic/api/contacts.ts @@ -1,8 +1,8 @@ import BaseApi from './base'; import { StoreState } from '../store/type'; -import { Patp, Path, Enc } from '../types/noun'; -import { Contact, ContactEdit } from '../types/contact-update'; -import { GroupPolicy, Resource } from '../types/group-update'; +import { Patp, Path, Enc } from '~/types/noun'; +import { Contact, ContactEdit } from '~/types/contact-update'; +import { GroupPolicy, Resource } from '~/types/group-update'; export default class ContactsApi extends BaseApi { create( diff --git a/pkg/interface/src/logic/api/global.ts b/pkg/interface/src/logic/api/global.ts index 9a06e48b5..f30f53026 100644 --- a/pkg/interface/src/logic/api/global.ts +++ b/pkg/interface/src/logic/api/global.ts @@ -1,4 +1,4 @@ -import { Patp } from '../types/noun'; +import { Patp } from '~/types/noun'; import BaseApi from './base'; import ChatApi from './chat'; import { StoreState } from '../store/type'; diff --git a/pkg/interface/src/logic/api/groups.ts b/pkg/interface/src/logic/api/groups.ts index a4fff41a2..60f98aef8 100644 --- a/pkg/interface/src/logic/api/groups.ts +++ b/pkg/interface/src/logic/api/groups.ts @@ -1,13 +1,13 @@ import BaseApi from './base'; import { StoreState } from '../store/type'; -import { Path, Patp, Enc } from '../types/noun'; +import { Path, Patp, Enc } from '~/types/noun'; import { GroupAction, GroupPolicy, Resource, Tag, GroupPolicyDiff, -} from '../types/group-update'; +} from '~/types/group-update'; export default class GroupsApi extends BaseApi { remove(resource: Resource, ships: Patp[]) { diff --git a/pkg/interface/src/logic/api/invite.ts b/pkg/interface/src/logic/api/invite.ts index 0e81ffec3..432a266bc 100644 --- a/pkg/interface/src/logic/api/invite.ts +++ b/pkg/interface/src/logic/api/invite.ts @@ -1,6 +1,6 @@ import BaseApi from "./base"; import { StoreState } from "../store/type"; -import { Serial, Path } from "../types/noun"; +import { Serial, Path } from "~/types/noun"; export default class InviteApi extends BaseApi { accept(app: Path, uid: Serial) { diff --git a/pkg/interface/src/logic/api/links.ts b/pkg/interface/src/logic/api/links.ts index de4af1e90..bb6e5812c 100644 --- a/pkg/interface/src/logic/api/links.ts +++ b/pkg/interface/src/logic/api/links.ts @@ -2,7 +2,7 @@ import { stringToTa } from '../lib/util'; import BaseApi from './base'; import { StoreState } from '../store/type'; -import { Path } from '../types/noun'; +import { Path } from '~/types/noun'; export default class LinksApi extends BaseApi { diff --git a/pkg/interface/src/logic/api/metadata.ts b/pkg/interface/src/logic/api/metadata.ts index 723abb9b1..216485ec6 100644 --- a/pkg/interface/src/logic/api/metadata.ts +++ b/pkg/interface/src/logic/api/metadata.ts @@ -1,7 +1,7 @@ import BaseApi from './base'; import { StoreState } from '../store/type'; -import { Path, Patp } from '../types/noun'; +import { Path, Patp } from '~/types/noun'; export default class MetadataApi extends BaseApi { diff --git a/pkg/interface/src/logic/api/publish.ts b/pkg/interface/src/logic/api/publish.ts index 4b60e66a1..ced75c480 100644 --- a/pkg/interface/src/logic/api/publish.ts +++ b/pkg/interface/src/logic/api/publish.ts @@ -1,7 +1,7 @@ import BaseApi from './base'; -import { PublishResponse } from '../types/publish-response'; -import { PatpNoSig } from '../types/noun'; -import { BookId, NoteId } from '../types/publish-update'; +import { PublishResponse } from '~/types/publish-response'; +import { PatpNoSig } from '~/types/noun'; +import { BookId, NoteId } from '~/types/publish-update'; export default class PublishApi extends BaseApi { handleEvent(data: PublishResponse) { diff --git a/pkg/interface/src/logic/lib/group.ts b/pkg/interface/src/logic/lib/group.ts index 2078ed368..64b035b51 100644 --- a/pkg/interface/src/logic/lib/group.ts +++ b/pkg/interface/src/logic/lib/group.ts @@ -1,5 +1,5 @@ -import { roleTags, RoleTags, Group, Resource } from '../../types/group-update'; -import { PatpNoSig, Path } from '../../types/noun'; +import { roleTags, RoleTags, Group, Resource } from '~/types/group-update'; +import { PatpNoSig, Path } from '~/types/noun'; export function roleForShip(group: Group, ship: PatpNoSig): RoleTags | undefined { diff --git a/pkg/interface/src/logic/reducers/chat-update.ts b/pkg/interface/src/logic/reducers/chat-update.ts index 5efe9cc23..292175038 100644 --- a/pkg/interface/src/logic/reducers/chat-update.ts +++ b/pkg/interface/src/logic/reducers/chat-update.ts @@ -1,8 +1,8 @@ import _ from 'lodash'; import { StoreState } from '../../../store/type'; -import { Cage } from '../../types/cage'; -import { ChatUpdate } from '../../types/chat-update'; -import { ChatHookUpdate } from '../../types/chat-hook-update'; +import { Cage } from '~/types/cage'; +import { ChatUpdate } from '~/types/chat-update'; +import { ChatHookUpdate } from '~/types/chat-hook-update'; type ChatState = Pick; diff --git a/pkg/interface/src/logic/reducers/connection.ts b/pkg/interface/src/logic/reducers/connection.ts index cc0aba6f0..958465433 100644 --- a/pkg/interface/src/logic/reducers/connection.ts +++ b/pkg/interface/src/logic/reducers/connection.ts @@ -1,6 +1,6 @@ import _ from 'lodash'; import { StoreState } from '../../store/type'; -import { Cage } from '../../types/cage'; +import { Cage } from '~/types/cage'; type LocalState = Pick; diff --git a/pkg/interface/src/logic/reducers/contact-update.ts b/pkg/interface/src/logic/reducers/contact-update.ts index c559d7b7e..88a527ed1 100644 --- a/pkg/interface/src/logic/reducers/contact-update.ts +++ b/pkg/interface/src/logic/reducers/contact-update.ts @@ -1,7 +1,7 @@ import _ from 'lodash'; import { StoreState } from '../../store/type'; -import { Cage } from '../../types/cage'; -import { ContactUpdate } from '../../types/contact-update'; +import { Cage } from '~/types/cage'; +import { ContactUpdate } from '~/types/contact-update'; type ContactState = Pick; diff --git a/pkg/interface/src/logic/reducers/group-update.ts b/pkg/interface/src/logic/reducers/group-update.ts index 1f584cbf1..09adb35b2 100644 --- a/pkg/interface/src/logic/reducers/group-update.ts +++ b/pkg/interface/src/logic/reducers/group-update.ts @@ -1,6 +1,6 @@ import _ from 'lodash'; import { StoreState } from '../../store/type'; -import { Cage } from '../../types/cage'; +import { Cage } from '~/types/cage'; import { GroupUpdate, Group, @@ -11,8 +11,8 @@ import { OpenPolicy, InvitePolicyDiff, InvitePolicy, -} from '../../types/group-update'; -import { Enc, PatpNoSig } from '../../types/noun'; +} from '~/types/group-update'; +import { Enc, PatpNoSig } from '~/types/noun'; import { resourceAsPath } from '../lib/util'; type GroupState = Pick; diff --git a/pkg/interface/src/logic/reducers/invite-update.ts b/pkg/interface/src/logic/reducers/invite-update.ts index 512e21b7f..bdeba0e4f 100644 --- a/pkg/interface/src/logic/reducers/invite-update.ts +++ b/pkg/interface/src/logic/reducers/invite-update.ts @@ -1,7 +1,7 @@ import _ from 'lodash'; import { StoreState } from '../../store/type'; -import { Cage } from '../../types/cage'; -import { InviteUpdate } from '../../types/invite-update'; +import { Cage } from '~/types/cage'; +import { InviteUpdate } from '~/types/invite-update'; type InviteState = Pick; diff --git a/pkg/interface/src/logic/reducers/launch-update.ts b/pkg/interface/src/logic/reducers/launch-update.ts index 96e968020..d05145d78 100644 --- a/pkg/interface/src/logic/reducers/launch-update.ts +++ b/pkg/interface/src/logic/reducers/launch-update.ts @@ -1,6 +1,6 @@ import _ from 'lodash'; -import { LaunchUpdate } from '../../types/launch-update'; -import { Cage } from '../../types/cage'; +import { LaunchUpdate } from '~/types/launch-update'; +import { Cage } from '~/types/cage'; import { StoreState } from '../../store/type'; type LaunchState = Pick; diff --git a/pkg/interface/src/logic/reducers/link-update.ts b/pkg/interface/src/logic/reducers/link-update.ts index 394c471a0..4d1db58ed 100644 --- a/pkg/interface/src/logic/reducers/link-update.ts +++ b/pkg/interface/src/logic/reducers/link-update.ts @@ -1,6 +1,6 @@ import _ from 'lodash'; import { StoreState } from '../../store/type'; -import { LinkUpdate, Pagination } from '../../types/link-update'; +import { LinkUpdate, Pagination } from '~/types/link-update'; // page size as expected from link-view. // must change in parallel with the +page-size in /app/link-view to diff --git a/pkg/interface/src/logic/reducers/listen-update.ts b/pkg/interface/src/logic/reducers/listen-update.ts index f823543cc..39e778da9 100644 --- a/pkg/interface/src/logic/reducers/listen-update.ts +++ b/pkg/interface/src/logic/reducers/listen-update.ts @@ -1,7 +1,7 @@ import _ from 'lodash'; import { StoreState } from '../../store/type'; -import { Cage } from '../../types/cage'; -import { LinkListenUpdate } from '../../types/link-listen-update'; +import { Cage } from '~/types/cage'; +import { LinkListenUpdate } from '~/types/link-listen-update'; type LinkListenState = Pick; diff --git a/pkg/interface/src/logic/reducers/local.ts b/pkg/interface/src/logic/reducers/local.ts index 6d1dcf793..650c71a98 100644 --- a/pkg/interface/src/logic/reducers/local.ts +++ b/pkg/interface/src/logic/reducers/local.ts @@ -1,7 +1,7 @@ import _ from 'lodash'; import { StoreState } from '../../store/type'; -import { Cage } from '../../types/cage'; -import { LocalUpdate } from '../../types/local-update'; +import { Cage } from '~/types/cage'; +import { LocalUpdate } from '~/types/local-update'; type LocalState = Pick; diff --git a/pkg/interface/src/logic/reducers/metadata-update.ts b/pkg/interface/src/logic/reducers/metadata-update.ts index 94b7e7953..99946665a 100644 --- a/pkg/interface/src/logic/reducers/metadata-update.ts +++ b/pkg/interface/src/logic/reducers/metadata-update.ts @@ -2,8 +2,8 @@ import _ from 'lodash'; import { StoreState } from '../../store/type'; -import { MetadataUpdate } from '../../types/metadata-update'; -import { Cage } from '../../types/cage'; +import { MetadataUpdate } from '~/types/metadata-update'; +import { Cage } from '~/types/cage'; type MetadataState = Pick; diff --git a/pkg/interface/src/logic/reducers/permission-update.ts b/pkg/interface/src/logic/reducers/permission-update.ts index 7d3ed4865..0d3dd438f 100644 --- a/pkg/interface/src/logic/reducers/permission-update.ts +++ b/pkg/interface/src/logic/reducers/permission-update.ts @@ -1,7 +1,7 @@ import _ from 'lodash'; import { StoreState } from '../../store/type'; -import { Cage } from '../../types/cage'; -import { PermissionUpdate } from '../../types/permission-update'; +import { Cage } from '~/types/cage'; +import { PermissionUpdate } from '~/types/permission-update'; type PermissionState = Pick; diff --git a/pkg/interface/src/logic/reducers/publish-response.ts b/pkg/interface/src/logic/reducers/publish-response.ts index 57ed8446c..a1cfb85ae 100644 --- a/pkg/interface/src/logic/reducers/publish-response.ts +++ b/pkg/interface/src/logic/reducers/publish-response.ts @@ -1,6 +1,6 @@ import _ from 'lodash'; import { StoreState } from '../../store/type'; -import { Cage } from '../../types/cage'; +import { Cage } from '~/types/cage'; type PublishState = Pick; diff --git a/pkg/interface/src/logic/reducers/publish-update.ts b/pkg/interface/src/logic/reducers/publish-update.ts index 25ea071b9..3be297737 100644 --- a/pkg/interface/src/logic/reducers/publish-update.ts +++ b/pkg/interface/src/logic/reducers/publish-update.ts @@ -1,9 +1,9 @@ import _ from 'lodash'; -import { PublishUpdate } from '../../types/publish-update'; -import { Cage } from '../../types/cage'; +import { PublishUpdate } from '~/types/publish-update'; +import { Cage } from '~/types/cage'; import { StoreState } from '../../store/type'; -import { getTagFromFrond } from '../../types/noun'; +import { getTagFromFrond } from '~/types/noun'; type PublishState = Pick; diff --git a/pkg/interface/src/logic/reducers/s3-update.ts b/pkg/interface/src/logic/reducers/s3-update.ts index 4d454ba40..0a4741cc7 100644 --- a/pkg/interface/src/logic/reducers/s3-update.ts +++ b/pkg/interface/src/logic/reducers/s3-update.ts @@ -1,7 +1,7 @@ import _ from 'lodash'; import { StoreState } from '../../store/type'; -import { Cage } from '../../types/cage'; -import { S3Update } from '../../types/s3-update'; +import { Cage } from '~/types/cage'; +import { S3Update } from '~/types/s3-update'; type S3State = Pick; diff --git a/pkg/interface/src/logic/store/store.ts b/pkg/interface/src/logic/store/store.ts index bc840f085..51d5ba7c3 100644 --- a/pkg/interface/src/logic/store/store.ts +++ b/pkg/interface/src/logic/store/store.ts @@ -5,7 +5,7 @@ import LocalReducer from '../reducers/local'; import ChatReducer from '../reducers/chat-update'; import { StoreState } from './type'; -import { Cage } from '../types/cage'; +import { Cage } from '~/types/cage'; import ContactReducer from '../reducers/contact-update'; import LinkUpdateReducer from '../reducers/link-update'; import S3Reducer from '../reducers/s3-update'; diff --git a/pkg/interface/src/logic/store/type.ts b/pkg/interface/src/logic/store/type.ts index 6ff247105..f8d6359dc 100644 --- a/pkg/interface/src/logic/store/type.ts +++ b/pkg/interface/src/logic/store/type.ts @@ -1,16 +1,16 @@ -import { Inbox, Envelope } from '../types/chat-update'; -import { ChatHookUpdate } from '../types/chat-hook-update'; -import { Path } from '../types/noun'; -import { Invites } from '../types/invite-update'; -import { Associations } from '../types/metadata-update'; -import { Rolodex } from '../types/contact-update'; -import { Notebooks } from '../types/publish-update'; -import { Groups } from '../types/group-update'; -import { S3State } from '../types/s3-update'; -import { Permissions } from '../types/permission-update'; -import { LaunchState, WeatherState } from '../types/launch-update'; -import { LinkComments, LinkCollections, LinkSeen } from '../types/link-update'; -import { ConnectionStatus } from '../types/connection'; +import { Inbox, Envelope } from '~/types/chat-update'; +import { ChatHookUpdate } from '~/types/chat-hook-update'; +import { Path } from '~/types/noun'; +import { Invites } from '~/types/invite-update'; +import { Associations } from '~/types/metadata-update'; +import { Rolodex } from '~/types/contact-update'; +import { Notebooks } from '~/types/publish-update'; +import { Groups } from '~/types/group-update'; +import { S3State } from '~/types/s3-update'; +import { Permissions } from '~/types/permission-update'; +import { LaunchState, WeatherState } from '~/types/launch-update'; +import { LinkComments, LinkCollections, LinkSeen } from '~/types/link-update'; +import { ConnectionStatus } from '~/types/connection'; export interface StoreState { // local state diff --git a/pkg/interface/src/logic/subscription/base.ts b/pkg/interface/src/logic/subscription/base.ts index d53e2acb1..481c014b0 100644 --- a/pkg/interface/src/logic/subscription/base.ts +++ b/pkg/interface/src/logic/subscription/base.ts @@ -1,6 +1,6 @@ import BaseStore from "../store/base"; import BaseApi from "../api/base"; -import { Path } from "../types/noun"; +import { Path } from "~/types/noun"; export default class BaseSubscription { private errorCount = 0; diff --git a/pkg/interface/src/logic/subscription/global.ts b/pkg/interface/src/logic/subscription/global.ts index 20760d725..6a3bb3701 100644 --- a/pkg/interface/src/logic/subscription/global.ts +++ b/pkg/interface/src/logic/subscription/global.ts @@ -1,6 +1,6 @@ import BaseSubscription from './base'; import { StoreState } from '../store/type'; -import { Path } from '../types/noun'; +import { Path } from '~/types/noun'; import _ from 'lodash'; diff --git a/pkg/interface/src/views/App.js b/pkg/interface/src/views/App.js index ba9e816d2..cbd4aab0a 100644 --- a/pkg/interface/src/views/App.js +++ b/pkg/interface/src/views/App.js @@ -18,11 +18,11 @@ import StatusBar from './components/StatusBar'; import Omnibox from './components/Omnibox'; import ErrorComponent from './components/Error'; -import GlobalStore from '../logic/store/store'; -import GlobalSubscription from '../logic/subscription/global'; -import GlobalApi from '../logic/api/global'; -import { uxToHex } from '../logic/lib/util'; -import { Sigil } from '../logic/lib/sigil'; +import GlobalStore from '~/logic/store/store'; +import GlobalSubscription from '~/logic/subscription/global'; +import GlobalApi from '~/logic/api/global'; +import { uxToHex } from '~/logic/lib/util'; +import { Sigil } from '~/logic/lib/sigil'; const Root = styled.div` font-family: ${p => p.theme.fonts.sans}; diff --git a/pkg/interface/src/views/apps/chat/app.tsx b/pkg/interface/src/views/apps/chat/app.tsx index ea8e97ad0..7f7239ee6 100644 --- a/pkg/interface/src/views/apps/chat/app.tsx +++ b/pkg/interface/src/views/apps/chat/app.tsx @@ -11,11 +11,11 @@ import { SettingsScreen } from './components/settings'; import { NewScreen } from './components/new'; import { JoinScreen } from './components/join'; import { NewDmScreen } from './components/new-dm'; -import { PatpNoSig } from '../../../types/noun'; -import GlobalApi from '../../logic/api/global'; -import { StoreState } from '../../logic/store/type'; -import GlobalSubscription from '../../logic/subscription/global'; -import {groupBunts} from '../../../types/group-update'; +import { PatpNoSig } from '~/types/noun'; +import GlobalApi from '~/logic/api/global'; +import { StoreState } from '~/logic/store/type'; +import GlobalSubscription from '~/logic/subscription/global'; +import {groupBunts} from '~/types/group-update'; type ChatAppProps = StoreState & { ship: PatpNoSig; diff --git a/pkg/interface/src/views/apps/chat/components/chat.tsx b/pkg/interface/src/views/apps/chat/components/chat.tsx index 46da1a334..ab9a4da13 100644 --- a/pkg/interface/src/views/apps/chat/components/chat.tsx +++ b/pkg/interface/src/views/apps/chat/components/chat.tsx @@ -6,15 +6,15 @@ import { Link, RouteComponentProps } from "react-router-dom"; import { ChatWindow } from './lib/chat-window'; import { ChatHeader } from './lib/chat-header'; import { ChatInput } from "./lib/chat-input"; -import { deSig } from "../../../../logic/lib/util"; -import { ChatHookUpdate } from "../../../../types/chat-hook-update"; -import ChatApi from "../../../../logic/api/chat"; -import { Inbox, Envelope } from "../../../../types/chat-update"; -import { Contacts } from "../../../../types/contact-update"; -import { Path, Patp } from "../../../../types/noun"; -import GlobalApi from "../../../../logic/api/global"; -import { Association } from "../../../../types/metadata-update"; -import {Group} from "../../../../types/group-update"; +import { deSig } from "~/logic/lib/util"; +import { ChatHookUpdate } from "~/types/chat-hook-update"; +import ChatApi from "~/logic/api/chat"; +import { Inbox, Envelope } from "~/types/chat-update"; +import { Contacts } from "~/types/contact-update"; +import { Path, Patp } from "~/types/noun"; +import GlobalApi from "~/logic/api/global"; +import { Association } from "~/types/metadata-update"; +import {Group} from "~/types/group-update"; type ChatScreenProps = RouteComponentProps<{ diff --git a/pkg/interface/src/views/apps/chat/components/join.js b/pkg/interface/src/views/apps/chat/components/join.js index 5d441ef87..6aa4845e8 100644 --- a/pkg/interface/src/views/apps/chat/components/join.js +++ b/pkg/interface/src/views/apps/chat/components/join.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { Spinner } from '../../../components/Spinner'; +import { Spinner } from '~/views/components/Spinner'; import urbitOb from 'urbit-ob'; export class JoinScreen extends Component { diff --git a/pkg/interface/src/views/apps/chat/components/lib/chat-header.js b/pkg/interface/src/views/apps/chat/components/lib/chat-header.js index ae503ee09..df43d08ac 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/chat-header.js +++ b/pkg/interface/src/views/apps/chat/components/lib/chat-header.js @@ -2,8 +2,8 @@ import React, { Component, Fragment } from "react"; import { Link } from "react-router-dom"; import { ChatTabBar } from "./chat-tabbar"; -import { SidebarSwitcher } from "../../../../components/SidebarSwitch"; -import { deSig } from "../../../../../logic/lib/util"; +import { SidebarSwitcher } from "~/views/components/SidebarSwitch"; +import { deSig } from "~/logic/lib/util"; export const ChatHeader = (props) => { diff --git a/pkg/interface/src/views/apps/chat/components/lib/chat-input.js b/pkg/interface/src/views/apps/chat/components/lib/chat-input.js index c18beb8d9..4e49680a1 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/chat-input.js +++ b/pkg/interface/src/views/apps/chat/components/lib/chat-input.js @@ -2,8 +2,8 @@ import React, { Component } from 'react'; import ChatEditor from './chat-editor'; import { S3Upload } from './s3-upload' ; -import { uxToHex } from '../../../../../logic/lib/util'; -import { Sigil } from '../../../../../logic/lib/sigil'; +import { uxToHex } from '~/logic/lib/util'; +import { Sigil } from '~/logic/lib/sigil'; const URL_REGEX = new RegExp(String(/^((\w+:\/\/)[-a-zA-Z0-9:@;?&=\/%\+\.\*!'\(\),\$_\{\}\^~\[\]`#|]+)/.source)); diff --git a/pkg/interface/src/views/apps/chat/components/lib/chat-scroll-container.js b/pkg/interface/src/views/apps/chat/components/lib/chat-scroll-container.js index a0a531feb..74580f995 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/chat-scroll-container.js +++ b/pkg/interface/src/views/apps/chat/components/lib/chat-scroll-container.js @@ -1,6 +1,6 @@ import React, { Component, Fragment } from "react"; -import { scrollIsAtTop, scrollIsAtBottom } from "../../../../../logic/lib/util"; +import { scrollIsAtTop, scrollIsAtBottom } from "~/logic/lib/util"; // Restore chat position on FF when new messages come in const recalculateScrollTop = (lastScrollHeight, scrollContainer) => { diff --git a/pkg/interface/src/views/apps/chat/components/lib/groupify-button.js b/pkg/interface/src/views/apps/chat/components/lib/groupify-button.js index 786c5d9a3..86cb34a75 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/groupify-button.js +++ b/pkg/interface/src/views/apps/chat/components/lib/groupify-button.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; -import Toggle from '../../../../components/toggle'; -import { InviteSearch } from '../../../../components/InviteSearch'; +import Toggle from '~/views/components/toggle'; +import { InviteSearch } from '~/views/components/InviteSearch'; export class GroupifyButton extends Component { diff --git a/pkg/interface/src/views/apps/chat/components/lib/invite-element.js b/pkg/interface/src/views/apps/chat/components/lib/invite-element.js index d3f88e79e..fe9edbd04 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/invite-element.js +++ b/pkg/interface/src/views/apps/chat/components/lib/invite-element.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; -import { InviteSearch } from '../../../../components/InviteSearch'; -import { Spinner } from '../../../../components/Spinner'; +import { InviteSearch } from '~/views/components/InviteSearch'; +import { Spinner } from '~/views/components/Spinner'; export class InviteElement extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/chat/components/lib/message.js b/pkg/interface/src/views/apps/chat/components/lib/message.js index 4958490bb..461423db7 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/message.js +++ b/pkg/interface/src/views/apps/chat/components/lib/message.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { OverlaySigil } from './overlay-sigil'; import MessageContent from './message-content'; -import { uxToHex, cite, writeText } from '../../../../../logic/lib/util'; +import { uxToHex, cite, writeText } from '~/logic/lib/util'; import moment from 'moment'; diff --git a/pkg/interface/src/views/apps/chat/components/lib/metadata-color.js b/pkg/interface/src/views/apps/chat/components/lib/metadata-color.js index 82c30563f..35ca0d425 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/metadata-color.js +++ b/pkg/interface/src/views/apps/chat/components/lib/metadata-color.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; -import { uxToHex } from '../../../../../logic/lib/util'; +import { uxToHex } from '~/logic/lib/util'; export class MetadataColor extends Component { diff --git a/pkg/interface/src/views/apps/chat/components/lib/metadata-settings.js b/pkg/interface/src/views/apps/chat/components/lib/metadata-settings.js index f396e5fd7..942135cfc 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/metadata-settings.js +++ b/pkg/interface/src/views/apps/chat/components/lib/metadata-settings.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { MetadataColor } from './metadata-color'; import { MetadataInput } from './metadata-input'; -import { uxToHex } from '../../../../../logic/lib/util'; +import { uxToHex } from '~/logic/lib/util'; export const MetadataSettings = (props) => { diff --git a/pkg/interface/src/views/apps/chat/components/lib/overlay-sigil.js b/pkg/interface/src/views/apps/chat/components/lib/overlay-sigil.js index 523835b04..4a7990822 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/overlay-sigil.js +++ b/pkg/interface/src/views/apps/chat/components/lib/overlay-sigil.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Sigil } from '../../../../../logic/lib/sigil'; +import { Sigil } from '~/logic/lib/sigil'; import { ProfileOverlay, OVERLAY_HEIGHT diff --git a/pkg/interface/src/views/apps/chat/components/lib/profile-overlay.js b/pkg/interface/src/views/apps/chat/components/lib/profile-overlay.js index 5168049bc..d05108278 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/profile-overlay.js +++ b/pkg/interface/src/views/apps/chat/components/lib/profile-overlay.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { cite } from '../../../../../logic/lib/util'; -import { Sigil } from '../../../../../logic/lib/sigil'; +import { cite } from '~/logic/lib/util'; +import { Sigil } from '~/logic/lib/sigil'; export const OVERLAY_HEIGHT = 250; diff --git a/pkg/interface/src/views/apps/chat/components/lib/s3-upload.js b/pkg/interface/src/views/apps/chat/components/lib/s3-upload.js index c6361168e..b497413cf 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/s3-upload.js +++ b/pkg/interface/src/views/apps/chat/components/lib/s3-upload.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import S3Client from '../../../../../logic/lib/s3'; +import S3Client from '~/logic/lib/s3'; export class S3Upload extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/chat/components/new-dm.js b/pkg/interface/src/views/apps/chat/components/new-dm.js index ef9979394..5e69eaa6f 100644 --- a/pkg/interface/src/views/apps/chat/components/new-dm.js +++ b/pkg/interface/src/views/apps/chat/components/new-dm.js @@ -1,9 +1,9 @@ import React, { Component } from 'react'; -import { Spinner } from '../../../components/Spinner'; +import { Spinner } from '~/views/components/Spinner'; import { Link } from 'react-router-dom'; -import { InviteSearch } from '../../../components/InviteSearch'; +import { InviteSearch } from '~/views/components/InviteSearch'; import urbitOb from 'urbit-ob'; -import { deSig } from '../../../../logic/lib/util'; +import { deSig } from '~/logic/lib/util'; export class NewDmScreen extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/chat/components/new.js b/pkg/interface/src/views/apps/chat/components/new.js index 15311206d..7464bbe8e 100644 --- a/pkg/interface/src/views/apps/chat/components/new.js +++ b/pkg/interface/src/views/apps/chat/components/new.js @@ -1,8 +1,8 @@ import React, { Component } from 'react'; -import { InviteSearch } from '../../../components/InviteSearch'; -import { Spinner } from '../../../components/Spinner'; +import { InviteSearch } from '~/views/components/InviteSearch'; +import { Spinner } from '~/views/components/Spinner'; import { Link } from 'react-router-dom'; -import { deSig } from '../../../../logic/lib/util'; +import { deSig } from '~/logic/lib/util'; export class NewScreen extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/chat/components/settings.js b/pkg/interface/src/views/apps/chat/components/settings.js index ea78bfa07..9b1b33936 100644 --- a/pkg/interface/src/views/apps/chat/components/settings.js +++ b/pkg/interface/src/views/apps/chat/components/settings.js @@ -1,14 +1,14 @@ import React, { Component, Fragment } from 'react'; -import { deSig } from '../../../../logic/lib/util'; +import { deSig } from '~/logic/lib/util'; import { Link } from 'react-router-dom'; import { ChatHeader } from './lib/chat-header'; import { MetadataSettings } from './lib/metadata-settings'; import { DeleteButton } from './lib/delete-button'; import { GroupifyButton } from './lib/groupify-button'; -import { Spinner } from '../../../components/Spinner'; +import { Spinner } from '~/views/components/Spinner'; import { ChatTabBar } from './lib/chat-tabbar'; -import SidebarSwitcher from '../../../components/SidebarSwitch'; +import SidebarSwitcher from '~/views/components/SidebarSwitch'; export class SettingsScreen extends Component { diff --git a/pkg/interface/src/views/apps/chat/components/sidebar.js b/pkg/interface/src/views/apps/chat/components/sidebar.js index 39f191990..bd7f3dce0 100644 --- a/pkg/interface/src/views/apps/chat/components/sidebar.js +++ b/pkg/interface/src/views/apps/chat/components/sidebar.js @@ -1,8 +1,8 @@ import React, { Component } from 'react'; import Welcome from './lib/welcome'; -import { alphabetiseAssociations } from '../../../../logic/lib/util'; -import SidebarInvite from '../../../components/SidebarInvite'; +import { alphabetiseAssociations } from '~/logic/lib/util'; +import SidebarInvite from '~/views/components/SidebarInvite'; import { GroupItem } from './lib/group-item'; export class Sidebar extends Component { diff --git a/pkg/interface/src/views/apps/chat/components/skeleton.js b/pkg/interface/src/views/apps/chat/components/skeleton.js index 8fa175712..d5678ff42 100644 --- a/pkg/interface/src/views/apps/chat/components/skeleton.js +++ b/pkg/interface/src/views/apps/chat/components/skeleton.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import classnames from 'classnames'; import { Link } from 'react-router-dom'; -import ErrorBoundary from '../../../components/ErrorBoundary'; +import ErrorBoundary from '~/views/components/ErrorBoundary'; export class Skeleton extends Component { render() { diff --git a/pkg/interface/src/views/apps/dojo/components/input.js b/pkg/interface/src/views/apps/dojo/components/input.js index 4bde441c8..51761ba21 100644 --- a/pkg/interface/src/views/apps/dojo/components/input.js +++ b/pkg/interface/src/views/apps/dojo/components/input.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; -import { cite } from '../../../../logic/lib/util'; -import { Spinner } from '../../../components/Spinner'; +import { cite } from '~/logic/lib/util'; +import { Spinner } from '~/views/components/Spinner'; export class Input extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/groups/app.tsx b/pkg/interface/src/views/apps/groups/app.tsx index 7ef051119..5e73f024b 100644 --- a/pkg/interface/src/views/apps/groups/app.tsx +++ b/pkg/interface/src/views/apps/groups/app.tsx @@ -11,10 +11,10 @@ import { AddScreen } from './components/lib/add-contact'; import { JoinScreen } from './components/join'; import GroupDetail from './components/lib/group-detail'; -import { PatpNoSig } from '../../../types/noun'; -import GlobalApi from '../../../logic/api/global'; -import { StoreState } from '../../../logic/store/type'; -import GlobalSubscription from '../../../logic/subscription/global'; +import { PatpNoSig } from '~/types/noun'; +import GlobalApi from '~/logic/api/global'; +import { StoreState } from '~/logic/store/type'; +import GlobalSubscription from '~/logic/subscription/global'; type GroupsAppProps = StoreState & { diff --git a/pkg/interface/src/views/apps/groups/components/join.js b/pkg/interface/src/views/apps/groups/components/join.js index 2db84d1c4..82b5016cf 100644 --- a/pkg/interface/src/views/apps/groups/components/join.js +++ b/pkg/interface/src/views/apps/groups/components/join.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { Spinner } from '../../../components/Spinner'; +import { Spinner } from '~/views/components/Spinner'; import urbitOb from 'urbit-ob'; export class JoinScreen extends Component { diff --git a/pkg/interface/src/views/apps/groups/components/lib/add-contact.tsx b/pkg/interface/src/views/apps/groups/components/lib/add-contact.tsx index 8132ca164..3a31bd935 100644 --- a/pkg/interface/src/views/apps/groups/components/lib/add-contact.tsx +++ b/pkg/interface/src/views/apps/groups/components/lib/add-contact.tsx @@ -1,12 +1,12 @@ import React, { Component } from 'react'; import _ from 'lodash'; import { Link } from 'react-router-dom'; -import { InviteSearch, Invites } from '../../../../components/InviteSearch'; -import { Spinner } from '../../../../components/Spinner'; +import { InviteSearch, Invites } from '~/views/components/InviteSearch'; +import { Spinner } from '~/views/components/Spinner'; import { uuid } from '../../../../lib/util'; -import { Groups } from '../../../../types/group-update'; -import { Rolodex } from '../../../../types/contact-update'; -import { Path } from '../../../../types/noun'; +import { Groups } from '~/types/group-update'; +import { Rolodex } from '~/types/contact-update'; +import { Path } from '~/types/noun'; import GlobalApi from '../../../../api/global'; import { History } from 'history'; diff --git a/pkg/interface/src/views/apps/groups/components/lib/contact-card.js b/pkg/interface/src/views/apps/groups/components/lib/contact-card.js index 9782f89ac..572f2f2f0 100644 --- a/pkg/interface/src/views/apps/groups/components/lib/contact-card.js +++ b/pkg/interface/src/views/apps/groups/components/lib/contact-card.js @@ -1,10 +1,10 @@ import React, { Component } from 'react'; -import { Sigil } from '../../../../../logic/lib/sigil'; +import { Sigil } from '~/logic/lib/sigil'; import { Link } from 'react-router-dom'; import { EditElement } from './edit-element'; -import { Spinner } from '../../../../components/Spinner'; -import { uxToHex } from '../../../../../logic/lib/util'; +import { Spinner } from '~/views/components/Spinner'; +import { uxToHex } from '~/logic/lib/util'; import { S3Upload } from './s3-upload'; export class ContactCard extends Component { diff --git a/pkg/interface/src/views/apps/groups/components/lib/contact-item.js b/pkg/interface/src/views/apps/groups/components/lib/contact-item.js index 35e3a6a54..fad0e5d75 100644 --- a/pkg/interface/src/views/apps/groups/components/lib/contact-item.js +++ b/pkg/interface/src/views/apps/groups/components/lib/contact-item.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { Sigil } from '../../../../../logic/lib/sigil'; -import { uxToHex, cite } from '../../../../../logic/lib/util'; +import { Sigil } from '~/logic/lib/sigil'; +import { uxToHex, cite } from '~/logic/lib/util'; export class ContactItem extends Component { render() { diff --git a/pkg/interface/src/views/apps/groups/components/lib/contact-sidebar.tsx b/pkg/interface/src/views/apps/groups/components/lib/contact-sidebar.tsx index d8445b708..f337efee5 100644 --- a/pkg/interface/src/views/apps/groups/components/lib/contact-sidebar.tsx +++ b/pkg/interface/src/views/apps/groups/components/lib/contact-sidebar.tsx @@ -4,14 +4,14 @@ import { FixedSizeList as List } from 'react-window'; import { ContactItem } from './contact-item'; import { ShareSheet } from './share-sheet'; -import { Sigil } from '../../../../../logic/lib/sigil'; -import { Spinner } from '../../../../components/Spinner'; -import { cite } from '../../../../../logic/lib/util'; -import { roleForShip, resourceFromPath } from '../../../../../logic/lib/group'; -import { Path, PatpNoSig } from '../../../../../types/noun'; -import { Rolodex, Contacts, Contact } from '../../../../../types/contact-update'; -import { Groups, Group } from '../../../../../types/group-update'; -import GlobalApi from '../../../../../logic/api/global'; +import { Sigil } from '~/logic/lib/sigil'; +import { Spinner } from '~/views/components/Spinner'; +import { cite } from '~/logic/lib/util'; +import { roleForShip, resourceFromPath } from '~/logic/lib/group'; +import { Path, PatpNoSig } from '~/types/noun'; +import { Rolodex, Contacts, Contact } from '~/types/contact-update'; +import { Groups, Group } from '~/types/group-update'; +import GlobalApi from '~/logic/api/global'; interface ContactSidebarProps { activeDrawer: 'contacts' | 'detail' | 'rightPanel'; diff --git a/pkg/interface/src/views/apps/groups/components/lib/group-detail.js b/pkg/interface/src/views/apps/groups/components/lib/group-detail.js index 17bdeaf25..0fb197aa7 100644 --- a/pkg/interface/src/views/apps/groups/components/lib/group-detail.js +++ b/pkg/interface/src/views/apps/groups/components/lib/group-detail.js @@ -1,11 +1,11 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { Spinner } from '../../../../components/Spinner'; -import { Toggle } from '../../../../components/toggle'; -import { GroupView } from '../../../../components/Group'; +import { Spinner } from '~/views/components/Spinner'; +import { Toggle } from '~/views/components/toggle'; +import { GroupView } from '~/views/components/Group'; -import { deSig, uxToHex, writeText } from '../../../../../logic/lib/util'; -import { roleForShip, resourceFromPath } from '../../../../../logic/lib/group'; +import { deSig, uxToHex, writeText } from '~/logic/lib/util'; +import { roleForShip, resourceFromPath } from '~/logic/lib/group'; export class GroupDetail extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/groups/components/lib/group-sidebar.js b/pkg/interface/src/views/apps/groups/components/lib/group-sidebar.js index 4c6cbe5a1..e4d0ccf79 100644 --- a/pkg/interface/src/views/apps/groups/components/lib/group-sidebar.js +++ b/pkg/interface/src/views/apps/groups/components/lib/group-sidebar.js @@ -2,11 +2,11 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import { GroupItem } from './group-item'; -import SidebarInvite from '../../../../components/SidebarInvite'; +import SidebarInvite from '~/views/components/SidebarInvite'; import { Welcome } from './welcome'; -import { cite } from '../../../../../logic/lib/util'; -import { Sigil } from '../../../../../logic/lib/sigil'; +import { cite } from '~/logic/lib/util'; +import { Sigil } from '~/logic/lib/sigil'; export class GroupSidebar extends Component { diff --git a/pkg/interface/src/views/apps/groups/components/lib/s3-upload.js b/pkg/interface/src/views/apps/groups/components/lib/s3-upload.js index 1231aa435..b94b14728 100644 --- a/pkg/interface/src/views/apps/groups/components/lib/s3-upload.js +++ b/pkg/interface/src/views/apps/groups/components/lib/s3-upload.js @@ -1,5 +1,5 @@ import React, { Component } from 'react' -import S3Client from '../../../../../logic/lib/s3'; +import S3Client from '~/logic/lib/s3'; export class S3Upload extends Component { diff --git a/pkg/interface/src/views/apps/groups/components/new.tsx b/pkg/interface/src/views/apps/groups/components/new.tsx index 4e16c69fb..528794737 100644 --- a/pkg/interface/src/views/apps/groups/components/new.tsx +++ b/pkg/interface/src/views/apps/groups/components/new.tsx @@ -1,15 +1,15 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { InviteSearch, Invites } from '../../../components/InviteSearch'; -import { Spinner } from '../../../components/Spinner'; -import { Toggle } from '../../../components/toggle'; +import { InviteSearch, Invites } from '~/views/components/InviteSearch'; +import { Spinner } from '~/views/components/Spinner'; +import { Toggle } from '~/views/components/toggle'; import { RouteComponentProps } from 'react-router-dom'; -import { Groups, GroupPolicy, Resource } from '../../../../types/group-update'; -import { Contacts, Rolodex } from '../../../../types/contact-update'; -import GlobalApi from '../../../../logic/api/global'; -import { Patp, PatpNoSig, Enc } from '../../../../types/noun'; +import { Groups, GroupPolicy, Resource } from '~/types/group-update'; +import { Contacts, Rolodex } from '~/types/contact-update'; +import GlobalApi from '~/logic/api/global'; +import { Patp, PatpNoSig, Enc } from '~/types/noun'; type NewScreenProps = Pick & { groups: Groups; diff --git a/pkg/interface/src/views/apps/groups/components/skeleton.js b/pkg/interface/src/views/apps/groups/components/skeleton.js index a3118703e..08e006869 100644 --- a/pkg/interface/src/views/apps/groups/components/skeleton.js +++ b/pkg/interface/src/views/apps/groups/components/skeleton.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { GroupSidebar } from './lib/group-sidebar'; -import ErrorBoundary from '../../../components/ErrorBoundary'; +import ErrorBoundary from '~/views/components/ErrorBoundary'; export class Skeleton extends Component { render() { diff --git a/pkg/interface/src/views/apps/launch/components/tiles/basic.js b/pkg/interface/src/views/apps/launch/components/tiles/basic.js index d091e4193..ff3701138 100644 --- a/pkg/interface/src/views/apps/launch/components/tiles/basic.js +++ b/pkg/interface/src/views/apps/launch/components/tiles/basic.js @@ -1,7 +1,7 @@ import React from 'react'; import classnames from 'classnames'; import { Link } from 'react-router-dom'; -import defaultApps from '../../../../../logic/lib/default-apps'; +import defaultApps from '~/logic/lib/default-apps'; import Tile from './tile'; diff --git a/pkg/interface/src/views/apps/links/app.js b/pkg/interface/src/views/apps/links/app.js index baa7629d8..983b15b67 100644 --- a/pkg/interface/src/views/apps/links/app.js +++ b/pkg/interface/src/views/apps/links/app.js @@ -16,7 +16,7 @@ import { makeRoutePath, amOwnerOfGroup, base64urlDecode -} from '../../../logic/lib/util'; +} from '~/logic/lib/util'; export class LinksApp extends Component { diff --git a/pkg/interface/src/views/apps/links/components/lib/channel-sidebar.js b/pkg/interface/src/views/apps/links/components/lib/channel-sidebar.js index 2d1a82fd4..6b36e9115 100644 --- a/pkg/interface/src/views/apps/links/components/lib/channel-sidebar.js +++ b/pkg/interface/src/views/apps/links/components/lib/channel-sidebar.js @@ -2,9 +2,9 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import { GroupItem } from './group-item'; -import SidebarInvite from '../../../../components/SidebarInvite'; +import SidebarInvite from '~/views/components/SidebarInvite'; import { Welcome } from './welcome'; -import { alphabetiseAssociations } from '../../../../../logic/lib/util'; +import { alphabetiseAssociations } from '~/logic/lib/util'; export class ChannelsSidebar extends Component { // drawer to the left diff --git a/pkg/interface/src/views/apps/links/components/lib/channels-item.js b/pkg/interface/src/views/apps/links/components/lib/channels-item.js index fce816b73..735cc79e8 100644 --- a/pkg/interface/src/views/apps/links/components/lib/channels-item.js +++ b/pkg/interface/src/views/apps/links/components/lib/channels-item.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { makeRoutePath } from '../../../../../logic/lib/util'; +import { makeRoutePath } from '~/logic/lib/util'; export class ChannelsItem extends Component { render() { diff --git a/pkg/interface/src/views/apps/links/components/lib/comment-item.js b/pkg/interface/src/views/apps/links/components/lib/comment-item.js index 3ef26e5fd..4693c5f61 100644 --- a/pkg/interface/src/views/apps/links/components/lib/comment-item.js +++ b/pkg/interface/src/views/apps/links/components/lib/comment-item.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; -import { Sigil } from '../../../../../logic/lib/sigil'; -import { cite } from '../../../../../logic/lib/util'; +import { Sigil } from '~/logic/lib/sigil'; +import { cite } from '~/logic/lib/util'; import moment from 'moment'; export class CommentItem extends Component { diff --git a/pkg/interface/src/views/apps/links/components/lib/comments-pagination.js b/pkg/interface/src/views/apps/links/components/lib/comments-pagination.js index 552d9d1c6..825c425b7 100644 --- a/pkg/interface/src/views/apps/links/components/lib/comments-pagination.js +++ b/pkg/interface/src/views/apps/links/components/lib/comments-pagination.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { makeRoutePath } from '../../../../../logic/lib/util'; +import { makeRoutePath } from '~/logic/lib/util'; export class CommentsPagination extends Component { render() { diff --git a/pkg/interface/src/views/apps/links/components/lib/comments.js b/pkg/interface/src/views/apps/links/components/lib/comments.js index a62c2074f..b6a55daa4 100644 --- a/pkg/interface/src/views/apps/links/components/lib/comments.js +++ b/pkg/interface/src/views/apps/links/components/lib/comments.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import { CommentItem } from './comment-item'; import { CommentsPagination } from './comments-pagination'; -import { getContactDetails } from '../../../../../logic/lib/util'; +import { getContactDetails } from '~/logic/lib/util'; export class Comments extends Component { constructor(props) { super(props); diff --git a/pkg/interface/src/views/apps/links/components/lib/invite-element.js b/pkg/interface/src/views/apps/links/components/lib/invite-element.js index 94da5d575..297f69359 100644 --- a/pkg/interface/src/views/apps/links/components/lib/invite-element.js +++ b/pkg/interface/src/views/apps/links/components/lib/invite-element.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; -import { InviteSearch } from '../../../../components/InviteSearch'; -import { Spinner } from '../../../../components/Spinner'; +import { InviteSearch } from '~/views/components/InviteSearch'; +import { Spinner } from '~/views/components/Spinner'; export class InviteElement extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/links/components/lib/link-detail-preview.js b/pkg/interface/src/views/apps/links/components/lib/link-detail-preview.js index 316d39a73..712870cb8 100644 --- a/pkg/interface/src/views/apps/links/components/lib/link-detail-preview.js +++ b/pkg/interface/src/views/apps/links/components/lib/link-detail-preview.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { cite } from '../../../../../logic/lib/util'; +import { cite } from '~/logic/lib/util'; import moment from 'moment'; export class LinkPreview extends Component { diff --git a/pkg/interface/src/views/apps/links/components/lib/link-item.js b/pkg/interface/src/views/apps/links/components/lib/link-item.js index a67552714..fce08e7b7 100644 --- a/pkg/interface/src/views/apps/links/components/lib/link-item.js +++ b/pkg/interface/src/views/apps/links/components/lib/link-item.js @@ -1,9 +1,9 @@ import React, { Component } from 'react'; import moment from 'moment'; -import { Sigil } from '../../../../../logic/lib/sigil'; +import { Sigil } from '~/logic/lib/sigil'; import { Link } from 'react-router-dom'; -import { makeRoutePath, cite } from '../../../../../logic/lib/util'; +import { makeRoutePath, cite } from '~/logic/lib/util'; export class LinkItem extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/links/components/lib/link-submit.js b/pkg/interface/src/views/apps/links/components/lib/link-submit.js index 36a5078db..fd132571e 100644 --- a/pkg/interface/src/views/apps/links/components/lib/link-submit.js +++ b/pkg/interface/src/views/apps/links/components/lib/link-submit.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Spinner } from '../../../../components/Spinner'; +import { Spinner } from '~/views/components/Spinner'; export class LinkSubmit extends Component { constructor() { diff --git a/pkg/interface/src/views/apps/links/components/lib/links-tabbar.js b/pkg/interface/src/views/apps/links/components/lib/links-tabbar.js index 31ed9833c..16a506d1f 100644 --- a/pkg/interface/src/views/apps/links/components/lib/links-tabbar.js +++ b/pkg/interface/src/views/apps/links/components/lib/links-tabbar.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { makeRoutePath } from '../../../../../logic/lib/util'; +import { makeRoutePath } from '~/logic/lib/util'; export class LinksTabBar extends Component { render() { diff --git a/pkg/interface/src/views/apps/links/components/lib/member-element.js b/pkg/interface/src/views/apps/links/components/lib/member-element.js index 2bc81f93b..9828d3bf4 100644 --- a/pkg/interface/src/views/apps/links/components/lib/member-element.js +++ b/pkg/interface/src/views/apps/links/components/lib/member-element.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; -import { Sigil } from '../../../../../logic/lib/sigil'; -import { uxToHex, cite } from '../../../../../logic/lib/util'; +import { Sigil } from '~/logic/lib/sigil'; +import { uxToHex, cite } from '~/logic/lib/util'; export class MemberElement extends Component { onRemove() { const { props } = this; diff --git a/pkg/interface/src/views/apps/links/components/lib/pagination.js b/pkg/interface/src/views/apps/links/components/lib/pagination.js index a8664787e..29f821453 100644 --- a/pkg/interface/src/views/apps/links/components/lib/pagination.js +++ b/pkg/interface/src/views/apps/links/components/lib/pagination.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { makeRoutePath } from '../../../../../logic/lib/util'; +import { makeRoutePath } from '~/logic/lib/util'; export class Pagination extends Component { render() { diff --git a/pkg/interface/src/views/apps/links/components/link.js b/pkg/interface/src/views/apps/links/components/link.js index 6d557cc78..a9e1c57db 100644 --- a/pkg/interface/src/views/apps/links/components/link.js +++ b/pkg/interface/src/views/apps/links/components/link.js @@ -1,12 +1,12 @@ import React, { Component } from 'react'; import { LinksTabBar } from './lib/links-tabbar'; import { LinkPreview } from './lib/link-detail-preview'; -import { SidebarSwitcher } from '../../../components/SidebarSwitch'; +import { SidebarSwitcher } from '~/views/components/SidebarSwitch'; import { Link } from 'react-router-dom'; import { Comments } from './lib/comments'; -import { Spinner } from '../../../components/Spinner'; +import { Spinner } from '~/views/components/Spinner'; import { LoadingScreen } from './loading'; -import { makeRoutePath, getContactDetails } from '../../../../logic/lib/util'; +import { makeRoutePath, getContactDetails } from '~/logic/lib/util'; import CommentItem from './lib/comment-item'; export class LinkDetail extends Component { diff --git a/pkg/interface/src/views/apps/links/components/links-list.js b/pkg/interface/src/views/apps/links/components/links-list.js index bdb0ee627..577b3ee05 100644 --- a/pkg/interface/src/views/apps/links/components/links-list.js +++ b/pkg/interface/src/views/apps/links/components/links-list.js @@ -3,13 +3,13 @@ import React, { Component } from 'react'; import { LoadingScreen } from './loading'; import { MessageScreen } from './lib/message-screen'; import { LinksTabBar } from './lib/links-tabbar'; -import { SidebarSwitcher } from '../../../components/SidebarSwitch'; +import { SidebarSwitcher } from '~/views/components/SidebarSwitch'; import { Link } from 'react-router-dom'; import { LinkItem } from './lib/link-item'; import { LinkSubmit } from './lib/link-submit'; import { Pagination } from './lib/pagination'; -import { makeRoutePath, getContactDetails } from '../../../../logic/lib/util'; +import { makeRoutePath, getContactDetails } from '~/logic/lib/util'; export class Links extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/links/components/member.js b/pkg/interface/src/views/apps/links/components/member.js index 74966fe71..52bd2b137 100644 --- a/pkg/interface/src/views/apps/links/components/member.js +++ b/pkg/interface/src/views/apps/links/components/member.js @@ -5,9 +5,9 @@ import { Link } from 'react-router-dom'; import { LoadingScreen } from './loading'; import { LinksTabBar } from './lib/links-tabbar'; import { MemberElement } from './lib/member-element'; -import { SidebarSwitcher } from '../../../components/SidebarSwitch'; -import { makeRoutePath } from '../../../../logic/lib/util'; -import { GroupView } from '../../../components/Group'; +import { SidebarSwitcher } from '~/views/components/SidebarSwitch'; +import { makeRoutePath } from '~/logic/lib/util'; +import { GroupView } from '~/views/components/Group'; export class MemberScreen extends Component { render() { diff --git a/pkg/interface/src/views/apps/links/components/new.js b/pkg/interface/src/views/apps/links/components/new.js index a73f12b77..3d32dff26 100644 --- a/pkg/interface/src/views/apps/links/components/new.js +++ b/pkg/interface/src/views/apps/links/components/new.js @@ -1,8 +1,8 @@ import React, { Component } from 'react'; -import { InviteSearch } from '../../../components/InviteSearch'; -import { Spinner } from '../../../components/Spinner'; +import { InviteSearch } from '~/views/components/InviteSearch'; +import { Spinner } from '~/views/components/Spinner'; import { Link } from 'react-router-dom'; -import { makeRoutePath, deSig } from '../../../../logic/lib/util'; +import { makeRoutePath, deSig } from '~/logic/lib/util'; import urbitOb from 'urbit-ob'; export class NewScreen extends Component { diff --git a/pkg/interface/src/views/apps/links/components/settings.js b/pkg/interface/src/views/apps/links/components/settings.js index 1e0b7516e..8d0153e46 100644 --- a/pkg/interface/src/views/apps/links/components/settings.js +++ b/pkg/interface/src/views/apps/links/components/settings.js @@ -1,12 +1,12 @@ import React, { Component } from 'react'; -import { uxToHex, makeRoutePath } from '../../../../logic/lib/util'; +import { uxToHex, makeRoutePath } from '~/logic/lib/util'; import { Link } from 'react-router-dom'; import { LoadingScreen } from './loading'; -import { Spinner } from '../../../components/Spinner'; +import { Spinner } from '~/views/components/Spinner'; import { LinksTabBar } from './lib/links-tabbar'; -import SidebarSwitcher from '../../../components/SidebarSwitch'; +import SidebarSwitcher from '~/views/components/SidebarSwitch'; export class SettingsScreen extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/links/components/skeleton.js b/pkg/interface/src/views/apps/links/components/skeleton.js index 24fed35e6..b6ff5a166 100644 --- a/pkg/interface/src/views/apps/links/components/skeleton.js +++ b/pkg/interface/src/views/apps/links/components/skeleton.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { ChannelsSidebar } from './lib/channel-sidebar'; -import ErrorBoundary from '../../../components/ErrorBoundary'; +import ErrorBoundary from '~/views/components/ErrorBoundary'; export class Skeleton extends Component { render() { diff --git a/pkg/interface/src/views/apps/publish/components/lib/comment-item.js b/pkg/interface/src/views/apps/publish/components/lib/comment-item.js index befdd5939..dfd4b43ca 100644 --- a/pkg/interface/src/views/apps/publish/components/lib/comment-item.js +++ b/pkg/interface/src/views/apps/publish/components/lib/comment-item.js @@ -1,8 +1,8 @@ import React, { Component } from 'react'; import moment from 'moment'; -import { Sigil } from '../../../../../logic/lib/sigil'; +import { Sigil } from '~/logic/lib/sigil'; import CommentInput from './comment-input'; -import { uxToHex, cite } from '../../../../../logic/lib/util'; +import { uxToHex, cite } from '~/logic/lib/util'; export class CommentItem extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/publish/components/lib/comments.js b/pkg/interface/src/views/apps/publish/components/lib/comments.js index 9bce9eb92..fbbe9011f 100644 --- a/pkg/interface/src/views/apps/publish/components/lib/comments.js +++ b/pkg/interface/src/views/apps/publish/components/lib/comments.js @@ -1,8 +1,8 @@ import React, { Component } from 'react'; import { CommentItem } from './comment-item'; import CommentInput from './comment-input'; -import { dateToDa } from '../../../../../logic/lib/util'; -import { Spinner } from '../../../../components/Spinner'; +import { dateToDa } from '~/logic/lib/util'; +import { Spinner } from '~/views/components/Spinner'; export class Comments extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/publish/components/lib/edit-post.js b/pkg/interface/src/views/apps/publish/components/lib/edit-post.js index 4041ca900..a259bbda3 100644 --- a/pkg/interface/src/views/apps/publish/components/lib/edit-post.js +++ b/pkg/interface/src/views/apps/publish/components/lib/edit-post.js @@ -1,9 +1,9 @@ import React, { Component } from 'react'; -import { SidebarSwitcher } from '../../../../components/SidebarSwitch'; -import { Spinner } from '../../../../components/Spinner'; +import { SidebarSwitcher } from '~/views/components/SidebarSwitch'; +import { Spinner } from '~/views/components/Spinner'; import { Link } from 'react-router-dom'; import { Controlled as CodeMirror } from 'react-codemirror2'; -import { dateToDa } from '../../../../../logic/lib/util'; +import { dateToDa } from '~/logic/lib/util'; import 'codemirror/mode/markdown/markdown'; diff --git a/pkg/interface/src/views/apps/publish/components/lib/join.js b/pkg/interface/src/views/apps/publish/components/lib/join.js index 3dfad2aa1..0269c5d51 100644 --- a/pkg/interface/src/views/apps/publish/components/lib/join.js +++ b/pkg/interface/src/views/apps/publish/components/lib/join.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { Spinner } from '../../../../components/Spinner'; +import { Spinner } from '~/views/components/Spinner'; import urbitOb from 'urbit-ob'; export class JoinScreen extends Component { diff --git a/pkg/interface/src/views/apps/publish/components/lib/new-post.js b/pkg/interface/src/views/apps/publish/components/lib/new-post.js index 52a61e79c..68e6f15ea 100644 --- a/pkg/interface/src/views/apps/publish/components/lib/new-post.js +++ b/pkg/interface/src/views/apps/publish/components/lib/new-post.js @@ -1,9 +1,9 @@ import React, { Component } from 'react'; -import { SidebarSwitcher } from '../../../../components/SidebarSwitch'; -import { Spinner } from '../../../../components/Spinner'; +import { SidebarSwitcher } from '~/views/components/SidebarSwitch'; +import { Spinner } from '~/views/components/Spinner'; import { Link } from 'react-router-dom'; import { Controlled as CodeMirror } from 'react-codemirror2'; -import { dateToDa, stringToSymbol } from '../../../../../logic/lib/util'; +import { dateToDa, stringToSymbol } from '~/logic/lib/util'; import 'codemirror/mode/markdown/markdown'; diff --git a/pkg/interface/src/views/apps/publish/components/lib/new.js b/pkg/interface/src/views/apps/publish/components/lib/new.js index aa3980e16..800a48356 100644 --- a/pkg/interface/src/views/apps/publish/components/lib/new.js +++ b/pkg/interface/src/views/apps/publish/components/lib/new.js @@ -1,8 +1,8 @@ import React, { Component } from 'react'; -import { InviteSearch } from '../../../../components/InviteSearch'; -import { Spinner } from '../../../../components/Spinner'; +import { InviteSearch } from '~/views/components/InviteSearch'; +import { Spinner } from '~/views/components/Spinner'; import { Link } from 'react-router-dom'; -import { stringToSymbol } from '../../../../../logic/lib/util'; +import { stringToSymbol } from '~/logic/lib/util'; export class NewScreen extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/publish/components/lib/note.js b/pkg/interface/src/views/apps/publish/components/lib/note.js index 7dd52c475..ec2c4ec86 100644 --- a/pkg/interface/src/views/apps/publish/components/lib/note.js +++ b/pkg/interface/src/views/apps/publish/components/lib/note.js @@ -1,12 +1,12 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { SidebarSwitcher } from '../../../../components/SidebarSwitch'; -import { Spinner } from '../../../../components/Spinner'; +import { SidebarSwitcher } from '~/views/components/SidebarSwitch'; +import { Spinner } from '~/views/components/Spinner'; import { Comments } from './comments'; import { NoteNavigation } from './note-navigation'; import moment from 'moment'; import ReactMarkdown from 'react-markdown'; -import { cite } from '../../../../../logic/lib/util'; +import { cite } from '~/logic/lib/util'; export class Note extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/publish/components/lib/notebook-posts.js b/pkg/interface/src/views/apps/publish/components/lib/notebook-posts.js index d068ec358..3061d12f2 100644 --- a/pkg/interface/src/views/apps/publish/components/lib/notebook-posts.js +++ b/pkg/interface/src/views/apps/publish/components/lib/notebook-posts.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import moment from 'moment'; import { Link } from 'react-router-dom'; import ReactMarkdown from 'react-markdown'; -import { cite } from '../../../../../logic/lib/util'; +import { cite } from '~/logic/lib/util'; export class NotebookPosts extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/publish/components/lib/notebook.js b/pkg/interface/src/views/apps/publish/components/lib/notebook.js index 06a004659..289f50c20 100644 --- a/pkg/interface/src/views/apps/publish/components/lib/notebook.js +++ b/pkg/interface/src/views/apps/publish/components/lib/notebook.js @@ -1,11 +1,11 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { SidebarSwitcher } from '../../../../components/SidebarSwitch'; +import { SidebarSwitcher } from '~/views/components/SidebarSwitch'; import { NotebookPosts } from './notebook-posts'; import { Subscribers } from './subscribers'; import { Settings } from './settings'; -import { cite } from '../../../../../logic/lib/util'; -import { roleForShip } from '../../../../../logic/lib/group'; +import { cite } from '~/logic/lib/util'; +import { roleForShip } from '~/logic/lib/group'; export class Notebook extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/publish/components/lib/settings.js b/pkg/interface/src/views/apps/publish/components/lib/settings.js index fa13197e5..1149ec350 100644 --- a/pkg/interface/src/views/apps/publish/components/lib/settings.js +++ b/pkg/interface/src/views/apps/publish/components/lib/settings.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; -import { Spinner } from '../../../../components/Spinner'; -import { InviteSearch } from '../../../../components/InviteSearch'; -import Toggle from '../../../../components/toggle'; +import { Spinner } from '~/views/components/Spinner'; +import { InviteSearch } from '~/views/components/InviteSearch'; +import Toggle from '~/views/components/toggle'; export class Settings extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/publish/components/lib/sidebar.js b/pkg/interface/src/views/apps/publish/components/lib/sidebar.js index c48b39763..b7e06eda2 100644 --- a/pkg/interface/src/views/apps/publish/components/lib/sidebar.js +++ b/pkg/interface/src/views/apps/publish/components/lib/sidebar.js @@ -1,9 +1,9 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import SidebarInvite from '../../../../components/SidebarInvite'; +import SidebarInvite from '~/views/components/SidebarInvite'; import { Welcome } from './welcome'; import { GroupItem } from './group-item'; -import { alphabetiseAssociations } from '../../../../../logic/lib/util'; +import { alphabetiseAssociations } from '~/logic/lib/util'; export class Sidebar extends Component { render() { diff --git a/pkg/interface/src/views/apps/publish/components/lib/subscribers.js b/pkg/interface/src/views/apps/publish/components/lib/subscribers.js index ede8b81a9..1a3f25ca0 100644 --- a/pkg/interface/src/views/apps/publish/components/lib/subscribers.js +++ b/pkg/interface/src/views/apps/publish/components/lib/subscribers.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; -import { GroupView } from '../../../../components/Group'; -import { resourceFromPath } from '../../../../../logic/lib/group'; +import { GroupView } from '~/views/components/Group'; +import { resourceFromPath } from '~/logic/lib/group'; export class Subscribers extends Component { constructor(props) { diff --git a/pkg/interface/src/views/apps/publish/components/skeleton.js b/pkg/interface/src/views/apps/publish/components/skeleton.js index ec87a98a9..e3c15bc13 100644 --- a/pkg/interface/src/views/apps/publish/components/skeleton.js +++ b/pkg/interface/src/views/apps/publish/components/skeleton.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Sidebar } from './lib/sidebar'; -import ErrorBoundary from '../../../components/ErrorBoundary'; +import ErrorBoundary from '~/views/components/ErrorBoundary'; export class Skeleton extends Component { render() { diff --git a/pkg/interface/src/views/components/Group.tsx b/pkg/interface/src/views/components/Group.tsx index 76d41651e..82b977840 100644 --- a/pkg/interface/src/views/components/Group.tsx +++ b/pkg/interface/src/views/components/Group.tsx @@ -3,22 +3,22 @@ import _, { capitalize } from 'lodash'; import { FixedSizeList as List } from 'react-window'; import { Dropdown } from '../apps/publish/components/lib/dropdown'; -import { cite, deSig } from '../../logic/lib/util'; -import { roleForShip, resourceFromPath } from '../../logic/lib/group'; +import { cite, deSig } from '~/logic/lib/util'; +import { roleForShip, resourceFromPath } from '~/logic/lib/group'; import { Group, InvitePolicy, OpenPolicy, roleTags, Groups, -} from '../../types/group-update'; -import { Path, PatpNoSig, Patp } from '../../types/noun'; +} from '~/types/group-update'; +import { Path, PatpNoSig, Patp } from '~/types/noun'; import GlobalApi from '../api/global'; import { Menu, MenuButton, MenuList, MenuItem } from '@tlon/indigo-react'; import InviteSearch, { Invites } from './InviteSearch'; import { Spinner } from './Spinner'; -import { Rolodex } from '../../types/contact-update'; -import { Associations } from '../../types/metadata-update'; +import { Rolodex } from '~/types/contact-update'; +import { Associations } from '~/types/metadata-update'; class GroupMember extends Component<{ ship: Patp; options: any[] }, {}> { render() { diff --git a/pkg/interface/src/views/components/InviteSearch.tsx b/pkg/interface/src/views/components/InviteSearch.tsx index 9502693f2..0bbdfe554 100644 --- a/pkg/interface/src/views/components/InviteSearch.tsx +++ b/pkg/interface/src/views/components/InviteSearch.tsx @@ -2,11 +2,11 @@ import React, { Component, createRef } from 'react'; import _ from 'lodash'; import Mousetrap from 'mousetrap'; import urbitOb from 'urbit-ob'; -import { Sigil } from '../../logic/lib/sigil'; -import { PatpNoSig, Path } from '../../types/noun'; -import { Groups} from '../../types/group-update'; -import { Rolodex, Contact } from '../../types/contact-update'; -import { Associations } from '../../types/metadata-update'; +import { Sigil } from '~/logic/lib/sigil'; +import { PatpNoSig, Path } from '~/types/noun'; +import { Groups} from '~/types/group-update'; +import { Rolodex, Contact } from '~/types/contact-update'; +import { Associations } from '~/types/metadata-update'; export interface Invites { ships: PatpNoSig[]; diff --git a/pkg/interface/src/views/components/Omnibox.js b/pkg/interface/src/views/components/Omnibox.js index ced7e11a9..cf88f10d2 100644 --- a/pkg/interface/src/views/components/Omnibox.js +++ b/pkg/interface/src/views/components/Omnibox.js @@ -1,12 +1,12 @@ import React, { Component } from 'react'; import { withRouter } from 'react-router-dom'; import { Box, Row, Rule, Text } from '@tlon/indigo-react'; -import index from '../../logic/lib/omnibox'; +import index from '~/logic/lib/omnibox'; import Mousetrap from 'mousetrap'; import OmniboxInput from './OmniboxInput'; import OmniboxResult from './OmniboxResult'; -import { cite } from '../../logic/lib/util'; +import { cite } from '~/logic/lib/util'; export class Omnibox extends Component { constructor(props) { diff --git a/pkg/interface/src/views/components/OmniboxResult.js b/pkg/interface/src/views/components/OmniboxResult.js index 83e3cc3f8..589ab12b7 100644 --- a/pkg/interface/src/views/components/OmniboxResult.js +++ b/pkg/interface/src/views/components/OmniboxResult.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Row, Icon, Text } from '@tlon/indigo-react'; -import defaultApps from '../../logic/lib/default-apps'; +import defaultApps from '~/logic/lib/default-apps'; export class OmniboxResult extends Component { constructor(props) { diff --git a/pkg/interface/src/views/components/SidebarInvite.tsx b/pkg/interface/src/views/components/SidebarInvite.tsx index 15ffa4730..eb57b9731 100644 --- a/pkg/interface/src/views/components/SidebarInvite.tsx +++ b/pkg/interface/src/views/components/SidebarInvite.tsx @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Invite } from '../types/invite-update'; +import { Invite } from '~/types/invite-update'; export class SidebarInvite extends Component<{invite: Invite, onAccept: Function, onDecline: Function}, {}> { render() { From 693ab48529cdca10e6f25dfaac9e71c254bc09a3 Mon Sep 17 00:00:00 2001 From: Tyler Brown Cifu Shuster Date: Sat, 15 Aug 2020 14:42:45 -0700 Subject: [PATCH 07/30] chat: account for digits in group name links --- .../src/views/apps/chat/components/lib/content/text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/interface/src/views/apps/chat/components/lib/content/text.js b/pkg/interface/src/views/apps/chat/components/lib/content/text.js index f44d9bd6a..6913ee34e 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/content/text.js +++ b/pkg/interface/src/views/apps/chat/components/lib/content/text.js @@ -41,7 +41,7 @@ export default class TextContent extends Component { const content = props.content; const group = content.text.match( - /([~][/])?(~[a-z]{3,6})(-[a-z]{6})?([/])(([a-z])+([/-])?)+/ + /([~][/])?(~[a-z]{3,6})(-[a-z]{6})?([/])(([a-z0-9])+([/-])?)+/ ); if ((group !== null) // matched possible chatroom && (group[2].length > 2) // possible ship? From 54a7acbfc2f7577e7be747d4aef8a62a5c222b33 Mon Sep 17 00:00:00 2001 From: Tyler Brown Cifu Shuster Date: Sat, 15 Aug 2020 15:01:11 -0700 Subject: [PATCH 08/30] leap: stop immediate propagation on invocation --- pkg/interface/src/logic/api/local.ts | 2 +- pkg/interface/src/views/App.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/interface/src/logic/api/local.ts b/pkg/interface/src/logic/api/local.ts index 77ff9b2b3..3c1abfa83 100644 --- a/pkg/interface/src/logic/api/local.ts +++ b/pkg/interface/src/logic/api/local.ts @@ -28,7 +28,7 @@ export default class LocalApi extends BaseApi { }); } - setOmnibox() { + setOmnibox() { this.store.handleEvent({ data: { local: { diff --git a/pkg/interface/src/views/App.js b/pkg/interface/src/views/App.js index ba9e816d2..92a6447c3 100644 --- a/pkg/interface/src/views/App.js +++ b/pkg/interface/src/views/App.js @@ -59,6 +59,7 @@ class App extends React.Component { this.api.local.getBaseHash(); Mousetrap.bindGlobal(['command+/', 'ctrl+/'], (e) => { e.preventDefault(); + e.stopImmediatePropagation(); this.api.local.setOmnibox(); }); this.setFavicon(); From 017749b8cfc55e4e461be3275579f7e72d9fc610 Mon Sep 17 00:00:00 2001 From: Tyler Brown Cifu Shuster Date: Sat, 15 Aug 2020 15:28:33 -0700 Subject: [PATCH 09/30] interface: updated tsconfig.json --- pkg/interface/tsconfig.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/interface/tsconfig.json b/pkg/interface/tsconfig.json index 5ec2a3e51..b8fc52a6c 100644 --- a/pkg/interface/tsconfig.json +++ b/pkg/interface/tsconfig.json @@ -12,7 +12,11 @@ "target": "es2015", "module": "es2015", "strict": true, - "jsx": "react" + "jsx": "react", + "baseUrl": ".", + "paths": { + "~/*": ["src/*"] + } }, "include": [ "src/**/*" From 1466ca2f48381003dd49f1b8bdf621ead2130cad Mon Sep 17 00:00:00 2001 From: Tyler Brown Cifu Shuster Date: Sat, 15 Aug 2020 19:23:06 -0700 Subject: [PATCH 10/30] chat: account for multiple dashes in group name links --- .../src/views/apps/chat/components/lib/content/text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/interface/src/views/apps/chat/components/lib/content/text.js b/pkg/interface/src/views/apps/chat/components/lib/content/text.js index 6913ee34e..8ddda4ef8 100644 --- a/pkg/interface/src/views/apps/chat/components/lib/content/text.js +++ b/pkg/interface/src/views/apps/chat/components/lib/content/text.js @@ -41,7 +41,7 @@ export default class TextContent extends Component { const content = props.content; const group = content.text.match( - /([~][/])?(~[a-z]{3,6})(-[a-z]{6})?([/])(([a-z0-9])+([/-])?)+/ + /([~][/])?(~[a-z]{3,6})(-[a-z]{6})?([/])(([a-z0-9-])+([/-])?)+/ ); if ((group !== null) // matched possible chatroom && (group[2].length > 2) // possible ship? From 516423b85316cfdf51c2a6da73b717676c76656e Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Mon, 17 Aug 2020 12:41:24 +1000 Subject: [PATCH 11/30] contact-hook: no-op on accepted invite The contact-hook was attempting to join a group upon it's invite being accepted. However, the join poke is also sent from the frontend, causing a potential race condition. Changes contact-hook to no-op on an %invite-update. --- pkg/arvo/app/contact-hook.hoon | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/pkg/arvo/app/contact-hook.hoon b/pkg/arvo/app/contact-hook.hoon index afdcee974..acb3b9572 100644 --- a/pkg/arvo/app/contact-hook.hoon +++ b/pkg/arvo/app/contact-hook.hoon @@ -164,10 +164,7 @@ (fact-group-update:cc wire !<(update:group-store q.cage.sign)) [cards this] :: - %invite-update - =^ cards state - (fact-invite-update:cc wire !<(invite-update q.cage.sign)) - [cards this] + %invite-update [~ this] == == :: @@ -481,17 +478,6 @@ [%pass / %agent [our.bol %invite-hook] %poke %invite-action !>(act)] -- :: -++ fact-invite-update - |= [wir=wire fact=invite-update] - ^- (quip card _state) - ?+ -.fact [~ state] - %accepted - =/ rid=resource - (de-path:resource path.invite.fact) - :_ state - ~[(contact-view-poke %join rid)] - == -:: ++ group-hook-poke |= =action:group-hook ^- card From f658d99c7606e78b929f3daa81fb98928802ec75 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Mon, 17 Aug 2020 12:47:40 +1000 Subject: [PATCH 12/30] pull-hook: no-op on double add If we receive an %add poke for a resource we are already pulling, no-op instead of crashing. This should prevent crashes upon repulling a resource after a breach of the host. --- pkg/arvo/lib/pull-hook.hoon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/lib/pull-hook.hoon b/pkg/arvo/lib/pull-hook.hoon index 6fdbf1007..23903fda6 100644 --- a/pkg/arvo/lib/pull-hook.hoon +++ b/pkg/arvo/lib/pull-hook.hoon @@ -225,7 +225,8 @@ ++ add |= [=ship =resource] ~| resource - ?< (~(has by tracking) resource) + ?: (~(has by tracking) resource) + [~ state] =. tracking (~(put by tracking) resource ship) :_ state From 5a1a994b9f67019c9cc631d88f917c568fbb3d5e Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Mon, 17 Aug 2020 12:51:45 +1000 Subject: [PATCH 13/30] group-store: Disallow joining of nonexisting groups Returns %.n upon requesting a join of group that does not exist --- pkg/arvo/app/group-store.hoon | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/app/group-store.hoon b/pkg/arvo/app/group-store.hoon index 0aa3634eb..bec225401 100644 --- a/pkg/arvo/app/group-store.hoon +++ b/pkg/arvo/app/group-store.hoon @@ -227,8 +227,11 @@ ++ peek-group-join |= [rid=resource =ship] - =/ =group - (~(gut by groups) rid *group) + =/ ugroup + (~(get by groups) rid) + ?~ ugroup + %.n + =* group u.ugroup =* policy policy.group ?- -.policy %invite From 494275b6ab9d03b8278f773d8e359e1219a13112 Mon Sep 17 00:00:00 2001 From: Tyler Brown Cifu Shuster Date: Sun, 16 Aug 2020 21:12:31 -0700 Subject: [PATCH 14/30] interface: track suspended element when leap loads --- pkg/interface/src/logic/reducers/local.ts | 9 ++++++++- pkg/interface/src/logic/store/store.ts | 1 + pkg/interface/src/logic/store/type.ts | 1 + pkg/interface/src/views/apps/dojo/components/input.js | 7 +++++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pkg/interface/src/logic/reducers/local.ts b/pkg/interface/src/logic/reducers/local.ts index 6d1dcf793..771054d12 100644 --- a/pkg/interface/src/logic/reducers/local.ts +++ b/pkg/interface/src/logic/reducers/local.ts @@ -3,7 +3,7 @@ import { StoreState } from '../../store/type'; import { Cage } from '../../types/cage'; import { LocalUpdate } from '../../types/local-update'; -type LocalState = Pick; +type LocalState = Pick; export default class LocalReducer { reduce(json: Cage, state: S) { @@ -24,6 +24,13 @@ export default class LocalReducer { omniboxShown(obj: LocalUpdate, state: S) { if ('omniboxShown' in obj) { state.omniboxShown = !state.omniboxShown; + if (state.suspendedFocus) { + state.suspendedFocus.focus(); + state.suspendedFocus = null; + } else { + state.suspendedFocus = document.activeElement; + document.activeElement?.blur(); + } } } diff --git a/pkg/interface/src/logic/store/store.ts b/pkg/interface/src/logic/store/store.ts index bc840f085..2473aa63a 100644 --- a/pkg/interface/src/logic/store/store.ts +++ b/pkg/interface/src/logic/store/store.ts @@ -42,6 +42,7 @@ export default class GlobalStore extends BaseStore { connection: 'connected', sidebarShown: true, omniboxShown: false, + suspendedFocus: null, baseHash: null, invites: {}, associations: { diff --git a/pkg/interface/src/logic/store/type.ts b/pkg/interface/src/logic/store/type.ts index 6ff247105..7ec6f40c7 100644 --- a/pkg/interface/src/logic/store/type.ts +++ b/pkg/interface/src/logic/store/type.ts @@ -16,6 +16,7 @@ export interface StoreState { // local state sidebarShown: boolean; omniboxShown: boolean; + suspendedFocus: HTMLInputElement | null; dark: boolean; connection: ConnectionStatus; baseHash: string | null; diff --git a/pkg/interface/src/views/apps/dojo/components/input.js b/pkg/interface/src/views/apps/dojo/components/input.js index 4bde441c8..dd4ed467e 100644 --- a/pkg/interface/src/views/apps/dojo/components/input.js +++ b/pkg/interface/src/views/apps/dojo/components/input.js @@ -80,8 +80,11 @@ render() { {this.props.prompt} Date: Mon, 17 Aug 2020 12:28:01 -0400 Subject: [PATCH 15/30] statusBar: rewrite in indigo, lineHeight tweaks --- .../src/views/components/ReconnectButton.js | 6 ++- .../src/views/components/StatusBar.js | 45 ++++++++++--------- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/pkg/interface/src/views/components/ReconnectButton.js b/pkg/interface/src/views/components/ReconnectButton.js index 2ffb026f9..674a0c75e 100644 --- a/pkg/interface/src/views/components/ReconnectButton.js +++ b/pkg/interface/src/views/components/ReconnectButton.js @@ -14,7 +14,8 @@ const ReconnectButton = ({ connection, subscription }) => { display='inline-block' color='red' border={1} - lineHeight='min' + verticalAlign="middle" + lineHeight='0' borderRadius={2} style={{ cursor: 'pointer' }} onClick={reconnect}> @@ -29,7 +30,8 @@ const ReconnectButton = ({ connection, subscription }) => { ml={4} px={2} py={1} - lineHeight="min" + lineHeight="0" + verticalAlign="middle" display='inline-block' color='yellow' border={1} diff --git a/pkg/interface/src/views/components/StatusBar.js b/pkg/interface/src/views/components/StatusBar.js index da80a9be2..34ba1b7b3 100644 --- a/pkg/interface/src/views/components/StatusBar.js +++ b/pkg/interface/src/views/components/StatusBar.js @@ -1,15 +1,12 @@ import React from 'react'; import { useLocation } from 'react-router-dom'; -import { Box, Text, Icon } from '@tlon/indigo-react'; +import { Row, Box, Text, Icon } from '@tlon/indigo-react'; import ReconnectButton from './ReconnectButton'; const StatusBar = (props) => { const location = useLocation(); const atHome = Boolean(location.pathname === '/'); - const display = (!window.location.href.includes('popout/')) - ? 'db' : 'dn'; - const invites = (props.invites && props.invites['/contacts']) ? props.invites['/contacts'] : {}; @@ -28,28 +25,32 @@ const StatusBar = (props) => { ); return ( -
-
+ + {atHome ? null : ( props.history.push('/')}> )} @@ -58,8 +59,9 @@ const StatusBar = (props) => { borderRadius={2} color='washedGray' display='inline-block' + verticalAlign='middle' + lineHeight="0" style={{ cursor: 'pointer' }} - lineHeight='min' py={1} px={2} onClick={() => props.api.local.setOmnibox()}> @@ -77,14 +79,15 @@ const StatusBar = (props) => { connection={props.connection} subscription={props.subscription} /> -
-
+ + { {Notification} Groups -
-
+ + ); }; From 4894fa2ccadd35b2317e0066a9c4a5320df2944b Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Mon, 17 Aug 2020 12:42:46 -0400 Subject: [PATCH 16/30] leap: add rounded corners to results panel Fixes #3330. --- pkg/interface/src/views/components/Omnibox.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/interface/src/views/components/Omnibox.js b/pkg/interface/src/views/components/Omnibox.js index cf88f10d2..2a6a9825b 100644 --- a/pkg/interface/src/views/components/Omnibox.js +++ b/pkg/interface/src/views/components/Omnibox.js @@ -192,7 +192,13 @@ export class Omnibox extends Component { renderResults() { const { props, state } = this; - return + return {this.getSearchedCategories() .map(category => Object({ category, categoryResults: state.results.get(category) })) .filter(category => category.categoryResults.length > 0) From 15e91602c1be90f7ee898bf3b11bb8dbe2dd28ee Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Mon, 17 Aug 2020 13:03:01 -0400 Subject: [PATCH 17/30] leap: results use overflow auto --- pkg/interface/src/views/components/Omnibox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/interface/src/views/components/Omnibox.js b/pkg/interface/src/views/components/Omnibox.js index 2a6a9825b..624229d20 100644 --- a/pkg/interface/src/views/components/Omnibox.js +++ b/pkg/interface/src/views/components/Omnibox.js @@ -194,7 +194,7 @@ export class Omnibox extends Component { const { props, state } = this; return Date: Mon, 17 Aug 2020 11:35:38 -0700 Subject: [PATCH 18/30] chat: refactored join page into indigo --- pkg/interface/package-lock.json | 34 ++++ pkg/interface/package.json | 3 +- .../src/views/apps/chat/components/join.js | 190 +++++++----------- 3 files changed, 108 insertions(+), 119 deletions(-) diff --git a/pkg/interface/package-lock.json b/pkg/interface/package-lock.json index 876bcf0cc..28388c405 100644 --- a/pkg/interface/package-lock.json +++ b/pkg/interface/package-lock.json @@ -4802,6 +4802,11 @@ } } }, + "fn-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/fn-name/-/fn-name-3.0.0.tgz", + "integrity": "sha512-eNMNr5exLoavuAMhIUVsOKF79SWd/zG104ef6sxBTSw+cZc6BXdQXDvYcGvp0VbxVVSp1XDUNoz7mg1xMtSznA==" + }, "follow-redirects": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.11.0.tgz", @@ -7450,6 +7455,11 @@ "react-is": "^16.8.1" } }, + "property-expr": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-2.0.3.tgz", + "integrity": "sha512-TEMKBo6s4gZUKmNYwaMkS2JdDxdWgUijW/U/jLAOHVyLZfU1KHXv+mC1J9gkfGOr8532XHqMJytko1lSjc0kmw==" + }, "proxy-addr": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", @@ -9070,6 +9080,11 @@ "xml-reader": "2.4.3" } }, + "synchronous-promise": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/synchronous-promise/-/synchronous-promise-2.0.13.tgz", + "integrity": "sha512-R9N6uDkVsghHePKh1TEqbnLddO2IY25OcsksyFp/qBe7XYd0PVbKEWxhcdMhpLzE1I6skj5l4aEZ3CRxcbArlA==" + }, "tabbable": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-4.0.0.tgz", @@ -9302,6 +9317,11 @@ "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true }, + "toposort": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz", + "integrity": "sha1-riF2gXXRVZ1IvvNUILL0li8JwzA=" + }, "transformation-matrix": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/transformation-matrix/-/transformation-matrix-2.1.1.tgz", @@ -11885,6 +11905,20 @@ "camelcase": "^5.0.0", "decamelize": "^1.2.0" } + }, + "yup": { + "version": "0.29.3", + "resolved": "https://registry.npmjs.org/yup/-/yup-0.29.3.tgz", + "integrity": "sha512-RNUGiZ/sQ37CkhzKFoedkeMfJM0vNQyaz+wRZJzxdKE7VfDeVKH8bb4rr7XhRLbHJz5hSjoDNwMEIaKhuMZ8gQ==", + "requires": { + "@babel/runtime": "^7.10.5", + "fn-name": "~3.0.0", + "lodash": "^4.17.15", + "lodash-es": "^4.17.11", + "property-expr": "^2.0.2", + "synchronous-promise": "^2.0.13", + "toposort": "^2.0.2" + } } } } diff --git a/pkg/interface/package.json b/pkg/interface/package.json index 6f062f7cf..40c51cdd9 100644 --- a/pkg/interface/package.json +++ b/pkg/interface/package.json @@ -32,7 +32,8 @@ "styled-system": "^5.1.5", "suncalc": "^1.8.0", "urbit-ob": "^5.0.0", - "urbit-sigil-js": "^1.3.2" + "urbit-sigil-js": "^1.3.2", + "yup": "^0.29.3" }, "devDependencies": { "@babel/core": "^7.9.0", diff --git a/pkg/interface/src/views/apps/chat/components/join.js b/pkg/interface/src/views/apps/chat/components/join.js index 6aa4845e8..b2dae0a77 100644 --- a/pkg/interface/src/views/apps/chat/components/join.js +++ b/pkg/interface/src/views/apps/chat/components/join.js @@ -1,146 +1,100 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; -import { Spinner } from '~/views/components/Spinner'; +import { Spinner } from '../../../components/Spinner'; import urbitOb from 'urbit-ob'; +import { Box, Text, Input, Button } from '@tlon/indigo-react'; +import { Formik, Form } from 'formik' +import * as Yup from 'yup'; + + +const schema = Yup.object().shape({ + station: Yup.string() + .lowercase() + .trim() + .test('is-station', + 'Chat must have a valid name', + (val) => + val && + val.split('/').length === 2 && + urbitOb.isValidPatp(val.split('/')[0]) + ) + .required('Required') +}); + export class JoinScreen extends Component { constructor(props) { super(props); this.state = { - station: '/', - error: false, awaiting: false }; - - this.stationChange = this.stationChange.bind(this); } componentDidMount() { - this.componentDidUpdate(); + if (this.props.station) { + this.onSubmit({ station: this.props.station }); + } } - componentDidUpdate(prevProps, prevState) { - const { props, state } = this; - - if ((props.autoJoin !== '/undefined/undefined') && - (props.api && (prevProps?.api !== props.api))) { - let station = props.autoJoin.split('/'); - - const ship = station[1]; - if ( - station.length < 2 || - !urbitOb.isValidPatp(ship) - ) { - this.setState({ - error: true - }); + onSubmit(values) { + console.log(values); + this.setState({ awaiting: true }, () => { + console.log(values); + const station = values.station.trim(); + if (`/${station}` in this.props.chatSynced) { + this.props.history.push(`/~chat/room/${station}`); return; } - station = props.autoJoin; - this.setState({ - station, - awaiting: true - }, () => props.api.chat.join(ship, station, true)); - } - - if (state.station in props.inbox || - (props?.chatSynced !== prevProps?.chatSynced && state.station !== '/')) { - this.setState({ awaiting: false }); - props.history.push(`/~chat/room${state.station}`); - } - } - - onClickJoin() { - const { props, state } = this; - - let station = state.station.split('/'); - - const ship = station[1]; - if ( - station.length < 2 || - !urbitOb.isValidPatp(ship) - ) { - this.setState({ - error: true - }); - return; - } - station = state.station.trim(); - - this.setState({ - station, - awaiting: true - }, () => { - props.api.chat.join(ship, station, true); - }); - } - - stationChange(event) { - this.setState({ - station: `/${event.target.value.trim()}` + props.api.chat.join(ship, station, true) + this.props.history.push(`/~chat/room/${station}`); }); } render() { - const { state } = this; - - let joinClasses = 'db f9 green2 ba pa2 b--green2 bg-gray0-d pointer'; - if ((!state.station) || (state.station === '/')) { - joinClasses = 'db f9 gray2 ba pa2 b--gray3 bg-gray0-d pointer'; - } - - let errElem = (); - if (state.error) { - errElem = ( - - Chat must have a valid name. - - ); - } + const { props, state } = this; return ( -
-
- {'⟵ All Chats'} -
-

Join Existing Chat

-
-

Enter a ~ship/chat-name

-

Chat names use lowercase, hyphens, and slashes.

-