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 ^- md-config
?~ jon ?~ jon
[%group ~] [%group ~]
?: ?=(%s -.jon)
[%graph p.jon]
?> ?=(%o -.jon) ?> ?=(%o -.jon)
?: (~(has by p.jon) %graph)
=/ mod
(~(got by p.jon) %graph)
?> ?=(%s -.mod)
[%graph p.mod]
=/ jin=json =/ jin=json
(~(got by p.jon) %group) (~(got by p.jon) %group)
?> ?=(%o -.jin) ?> ?=(%o -.jin)

View File

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

View File

@ -4,7 +4,6 @@
++ grow ++ grow
|% |%
++ noun update ++ noun update
++ metadata-update update
++ json (update:enjs:store 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') { if (each['app-name'] === 'graph') {
app = each.metadata.module; app = each.metadata.config.graph;
} }
const shipStart = each.resource.substr(each.resource.indexOf('~')); const shipStart = each.resource.substr(each.resource.indexOf('~'));
@ -128,7 +128,7 @@ export default function index(contacts, associations, apps, currentGroup, groups
); );
landscape.push(obj); landscape.push(obj);
} else { } else {
const app = each.metadata.module || each['app-name']; const app = each.metadata.config.graph || each['app-name'];
let group = each.group; let group = each.group;
if (groups[each.group]?.hidden && app === 'chat') { if (groups[each.group]?.hidden && app === 'chat') {
group = '/messages'; group = '/messages';

View File

@ -3,7 +3,10 @@ import React, {
useState, useState,
useCallback, useCallback,
useLayoutEffect, useLayoutEffect,
useRef,
useEffect,
} from "react"; } from "react";
import usePreviousValue from "./usePreviousValue";
export interface VirtualContextProps { export interface VirtualContextProps {
save: () => void; save: () => void;
@ -45,3 +48,18 @@ export function useVirtualResizeState(s: boolean) {
return [state, setState] as const; 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() { restart() {
for (let key in Object.keys(this.openSubscriptions)) {
let val = this.openSubscriptions[key];
this.unsubscribe(val.id);
}
this.start(); 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 // we need to hack this into a regular input that has some funny behaviors
const inputProxy = (input) => new Proxy(input, { const inputProxy = (input) => new Proxy(input, {
get(target, property) { get(target, property) {
if(property === 'focus') {
return () => {
target.focus();
}
}
if (property in target) { if (property in target) {
return target[property]; return target[property];
} }
if (property === 'execCommand') {
return () => {
target.setSelectionRange(target.value.length, target.value.length);
input.blur();
input.focus();
}
}
if (property === 'setOption') { if (property === 'setOption') {
return () => {}; return () => {};
} }
@ -108,7 +120,9 @@ export default class ChatEditor extends Component {
if (prevProps.message !== props.message) { if (prevProps.message !== props.message) {
this.editor.setValue(props.message); this.editor.setValue(props.message);
this.editor.setOption('mode', MARKDOWN_CONFIG); this.editor.setOption('mode', MARKDOWN_CONFIG);
this.editor?.element?.focus(); this.editor?.focus();
this.editor.execCommand('goDocEnd');
this.editor?.focus();
return; return;
} }

View File

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

View File

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

View File

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

View File

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