Merge 4bc7952d56 into release/next-js

This commit is contained in:
janeway-bot 2021-04-02 18:57:25 +04:00 committed by GitHub
commit 621bcc8be4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 52 additions and 15 deletions

View File

@ -189,9 +189,12 @@
^- md-config
?~ jon
[%group ~]
?: ?=(%s -.jon)
[%graph p.jon]
?> ?=(%o -.jon)
?: (~(has by p.jon) %graph)
=/ mod
(~(got by p.jon) %graph)
?> ?=(%s -.mod)
[%graph p.mod]
=/ jin=json
(~(got by p.jon) %group)
?> ?=(%o -.jin)

View File

@ -277,6 +277,9 @@
::
++ unversioned
?> ?=([%ship @ @ *] t.path)
?. =(min-version.config 0)
~& >>> "unversioned req from: {<src.bowl>}, nooping"
`this
=/ =resource
(de-path:resource t.path)
=/ =vase
@ -443,6 +446,7 @@
(fact:io cage ~(tap in paths))
:: TODO: deprecate
++ unversioned
?. =(min-version.config 0) ~
=/ prefix=path
resource+(en-path:resource rid)
=/ unversioned=(set path)

View File

@ -4,7 +4,6 @@
++ grow
|%
++ noun update
++ metadata-update update
++ json (update:enjs:store update)
--
::

View File

@ -114,7 +114,7 @@ export default function index(contacts, associations, apps, currentGroup, groups
};
if (each['app-name'] === 'graph') {
app = each.metadata.module;
app = each.metadata.config.graph;
}
const shipStart = each.resource.substr(each.resource.indexOf('~'));
@ -128,7 +128,7 @@ export default function index(contacts, associations, apps, currentGroup, groups
);
landscape.push(obj);
} else {
const app = each.metadata.module || each['app-name'];
const app = each.metadata.config.graph || each['app-name'];
let group = each.group;
if (groups[each.group]?.hidden && app === 'chat') {
group = '/messages';

View File

@ -3,7 +3,10 @@ import React, {
useState,
useCallback,
useLayoutEffect,
useRef,
useEffect,
} from "react";
import usePreviousValue from "./usePreviousValue";
export interface VirtualContextProps {
save: () => void;
@ -45,3 +48,18 @@ export function useVirtualResizeState(s: boolean) {
return [state, setState] as const;
}
export function useVirtualResizeProp<T>(prop: T) {
const { save, restore } = useVirtual();
const oldProp = usePreviousValue(prop)
if(prop !== oldProp) {
save();
}
useLayoutEffect(() => {
restore();
}, [prop]);
}

View File

@ -49,12 +49,6 @@ export default class GlobalSubscription extends BaseSubscription<StoreState> {
}
restart() {
for (let key in Object.keys(this.openSubscriptions)) {
let val = this.openSubscriptions[key];
this.unsubscribe(val.id);
}
this.start();
}
}

View File

@ -42,9 +42,21 @@ const MARKDOWN_CONFIG = {
// we need to hack this into a regular input that has some funny behaviors
const inputProxy = (input) => new Proxy(input, {
get(target, property) {
if(property === 'focus') {
return () => {
target.focus();
}
}
if (property in target) {
return target[property];
}
if (property === 'execCommand') {
return () => {
target.setSelectionRange(target.value.length, target.value.length);
input.blur();
input.focus();
}
}
if (property === 'setOption') {
return () => {};
}
@ -108,7 +120,9 @@ export default class ChatEditor extends Component {
if (prevProps.message !== props.message) {
this.editor.setValue(props.message);
this.editor.setOption('mode', MARKDOWN_CONFIG);
this.editor?.element?.focus();
this.editor?.focus();
this.editor.execCommand('goDocEnd');
this.editor?.focus();
return;
}

View File

@ -23,6 +23,7 @@ import { Link } from "react-router-dom";
import useGraphState from "~/logic/state/graph";
import { GraphNodeContent } from "../notifications/graph";
import { TranscludedNode } from "./TranscludedNode";
import {useVirtualResizeProp} from "~/logic/lib/virtualContext";
function GroupPermalink(props: { group: string; api: GlobalApi }) {
const { group, api } = props;
@ -61,6 +62,8 @@ function GraphPermalink(
graph,
])
);
useVirtualResizeProp(node)
useEffect(() => {
(async () => {
if (pending || !index) {

View File

@ -217,6 +217,7 @@ return;
src={url}
style={style}
onLoad={onLoad}
objectFit="contain"
{...audioProps}
{...props}
/>
@ -235,6 +236,7 @@ return;
src={url}
style={style}
onLoad={onLoad}
objectFit="contain"
{...videoProps}
{...props}
/>

View File

@ -24,9 +24,9 @@ export function DeleteGroup(props: {
return;
}
if(props.owner) {
await props.api.groups.deleteGroup(ship, name);
props.api.groups.deleteGroup(ship, name);
} else {
await props.api.groups.leaveGroup(ship, name);
props.api.groups.leaveGroup(ship, name);
}
history.push('/');
};

View File

@ -66,7 +66,7 @@ export function GroupFeedSettings(props: {
</Label>
</Col>
</BaseLabel>
{isEnabled && false && (
{isEnabled && (
<>
<GroupFeedPermsInput id="permissions" />
<FormSubmit start>Update Permissions</FormSubmit>