mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 16:51:42 +03:00
Merge 4bc7952d56
into release/next-js
This commit is contained in:
commit
621bcc8be4
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -4,7 +4,6 @@
|
||||
++ grow
|
||||
|%
|
||||
++ noun update
|
||||
++ metadata-update update
|
||||
++ json (update:enjs:store update)
|
||||
--
|
||||
::
|
||||
|
@ -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';
|
||||
|
@ -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]);
|
||||
|
||||
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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}
|
||||
/>
|
||||
|
@ -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('/');
|
||||
};
|
||||
|
@ -66,7 +66,7 @@ export function GroupFeedSettings(props: {
|
||||
</Label>
|
||||
</Col>
|
||||
</BaseLabel>
|
||||
{isEnabled && false && (
|
||||
{isEnabled && (
|
||||
<>
|
||||
<GroupFeedPermsInput id="permissions" />
|
||||
<FormSubmit start>Update Permissions</FormSubmit>
|
||||
|
Loading…
Reference in New Issue
Block a user