Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

823 changes: 0 additions & 823 deletions .yarn/releases/yarn-3.3.1.cjs

This file was deleted.

873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.5.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarn/sdks/eslint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint",
"version": "8.31.0-sdk",
"version": "8.36.0-sdk",
"main": "./lib/api.js",
"type": "commonjs"
}
2 changes: 1 addition & 1 deletion .yarn/sdks/prettier/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prettier",
"version": "2.8.2-sdk",
"version": "2.8.6-sdk",
"main": "./index.js",
"type": "commonjs"
}
2 changes: 1 addition & 1 deletion .yarn/sdks/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typescript",
"version": "4.9.4-sdk",
"version": "5.0.2-sdk",
"main": "./lib/typescript.js",
"type": "commonjs"
}
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.3.1.cjs
yarnPath: .yarn/releases/yarn-3.5.0.cjs
10 changes: 5 additions & 5 deletions common/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
"author": "",
"license": "ISC",
"devDependencies": {
"typescript": "^4.9.4"
"typescript": "^5.0.2"
},
"dependencies": {
"@common/config": "^1.2.0",
"@common/frontend-utils": "^1.2.5",
"@common/models": "workspace:^",
"@furystack/shades": "^6.1.5",
"@furystack/shades-common-components": "^3.6.1",
"@furystack/shades-lottie": "^2.1.5",
"@furystack/utils": "^3.1.4"
"@furystack/shades": "^7.2.3",
"@furystack/shades-common-components": "^4.0.12",
"@furystack/shades-lottie": "^3.0.11",
"@furystack/utils": "^3.1.7"
},
"typings": "dist/index.d.ts",
"main": "dist/index.js"
Expand Down
21 changes: 8 additions & 13 deletions common/components/src/member-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,14 @@ export type MemberListProps = { users: auth.Profile[]; addLabel: string } & (
}
)

export interface MemberListState {
users: auth.Profile[]
}

export const MemberList = Shade<MemberListProps, MemberListState>({
export const MemberList = Shade<MemberListProps>({
shadowDomName: 'multiverse-member-list',
getInitialState: ({ props }) => ({
users: props.users,
}),
render: ({ props, getState, updateState }) => {
render: ({ props, useState }) => {
const [users, setUsers] = useState('users', props.users)

return (
<div style={{ display: 'flex', background: 'rgba(128,128,128,0.2)', flexWrap: 'wrap', position: 'relative' }}>
{getState().users.map((u) => (
{users.map((u) => (
<div
style={{
display: 'flex',
Expand All @@ -51,7 +46,7 @@ export const MemberList = Shade<MemberListProps, MemberListState>({
title="Remove"
onclick={() => {
props.onRemoveMember(u)
updateState({ users: getState().users.filter((usr) => usr.username !== u.username) })
setUsers(users.filter((usr) => usr.username !== u.username))
}}
>
❌
Expand All @@ -68,9 +63,9 @@ export const MemberList = Shade<MemberListProps, MemberListState>({
prefix=""
onSelectUser={(user) => {
props.onAddMember(user)
updateState({ users: [...getState().users, user] })
setUsers([...users, user])
}}
exclude={(user) => (getState().users.find((usr) => usr.username === user.username) ? true : false)}
exclude={(user) => (users.find((usr) => usr.username === user.username) ? true : false)}
/>
) : null}
</div>
Expand Down
16 changes: 9 additions & 7 deletions common/components/src/my-avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@ import { Shade, createComponent } from '@furystack/shades'
import { SessionService, MyAvatarService } from '@common/frontend-utils'
import { Avatar } from './avatar'

export const MyAvatar = Shade<PartialElement<HTMLDivElement>, { lastUpdateDate: Date }>({
getInitialState: ({ injector }) => ({ lastUpdateDate: injector.getInstance(MyAvatarService).lastUpdate.getValue() }),
export const MyAvatar = Shade<PartialElement<HTMLDivElement>>({
shadowDomName: 'multiverse-my-avatar',
constructed: ({ injector, updateState }) => {
resources: ({ useState, injector }) => {
const [, setUpdateDate] = useState('updateDate', 0)
const observable = injector
.getInstance(MyAvatarService)
.lastUpdate.subscribe((lastUpdateDate) => updateState({ lastUpdateDate }))
return () => observable.dispose()
.lastUpdate.subscribe((lastUpdateDate) => setUpdateDate(lastUpdateDate.valueOf()))
return [observable]
},
render: ({ injector, props, getState }) => {
render: ({ injector, useState, props }) => {
const [updateDate] = useState('updateDate', 0)

const username = injector.getInstance(SessionService).currentUser.getValue()?.username
if (username) {
return <Avatar userName={username} query={`updated=${getState().lastUpdateDate.toISOString()}`} {...props} />
return <Avatar userName={username} query={`updated=${updateDate}`} {...props} />
}
return <div />
},
Expand Down
1 change: 1 addition & 0 deletions common/components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// "checkJs": true, /* Report errors in .js files. */
"jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
"jsxFactory": "createComponent",
"jsxFragmentFactory": "createComponent",
"declaration": true /* Generates corresponding '.d.ts' file. */,
"declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */,
"sourceMap": true /* Generates corresponding '.map' file. */,
Expand Down
6 changes: 3 additions & 3 deletions common/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"build": "tsc -b"
},
"dependencies": {
"@types/node": "^18.11.18",
"mongodb": "4.13.0",
"tslib": "^2.4.1"
"@types/node": "^18.15.11",
"mongodb": "5.1.0",
"tslib": "^2.5.0"
}
}
14 changes: 7 additions & 7 deletions common/frontend-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"dependencies": {
"@common/config": "^1.2.0",
"@common/models": "^1.3.1",
"@furystack/core": "^11.2.2",
"@furystack/inject": "^7.1.4",
"@furystack/rest-client-fetch": "^4.1.5",
"@furystack/shades-common-components": "^3.6.1",
"@furystack/utils": "^3.1.4",
"@types/node": "^18.11.18",
"tslib": "^2.4.1"
"@furystack/core": "^11.2.12",
"@furystack/inject": "^7.1.8",
"@furystack/rest-client-fetch": "^4.1.17",
"@furystack/shades-common-components": "^4.0.12",
"@furystack/utils": "^3.1.7",
"@types/node": "^18.15.11",
"tslib": "^2.5.0"
}
}
11 changes: 7 additions & 4 deletions common/frontend-utils/src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,21 @@ export class SessionService implements IdentityContext {
return currentUser as unknown as TUser
}

public currentProfileUpdate = this.currentUser.subscribe(async (usr) => {
if (usr) {
public reloadProfile = async () => {
const username = this.currentUser.getValue()?.username
if (username) {
const { result: profile } = await useAuthApi(this.injector)({
method: 'GET',
action: '/profiles/:username',
url: { username: usr.username },
url: { username },
})
this.currentProfile.setValue(profile)
} else {
this.currentProfile.setValue(null as any)
}
})
}

public currentProfileUpdate = this.currentUser.subscribe(() => this.reloadProfile())

public currentProfile = new ObservableValue<auth.Profile>()

Expand Down
4 changes: 4 additions & 0 deletions common/frontend-utils/src/theme-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
setCssVariable,
ThemeProviderService,
} from '@furystack/shades-common-components'
import { ObservableValue } from '@furystack/utils'

const lightBackground = 'linear-gradient(to right bottom, #ebebf8, #e3e3f6, #dcdcf4, #d4d4f2, #cdcdf0)'
const darkBackground = 'linear-gradient(to right bottom, #2b3036, #292c31, #27282d, #242428, #212023)'
Expand All @@ -21,9 +22,12 @@ export class ThemeService {
return 'var(--multiverse-background)'
}

public readonly themeNameObservable = new ObservableValue<ThemePreset>(this.themeName)

public setTheme(themeName: ThemePreset) {
const root = document.querySelector(':root') as HTMLElement
this.themeName = themeName
this.themeNameObservable.setValue(themeName)
switch (themeName) {
case 'light':
this.themeProviderService.set(defaultLightTheme)
Expand Down
12 changes: 6 additions & 6 deletions common/models/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
},
"types": "dist/index.d.ts",
"dependencies": {
"@furystack/core": "^11.2.2",
"@furystack/logging": "^3.1.4",
"@furystack/rest": "^4.1.5",
"@types/node": "^18.11.18",
"@furystack/core": "^11.2.12",
"@furystack/logging": "^3.1.8",
"@furystack/rest": "^4.1.17",
"@types/node": "^18.15.11",
"ts-json-schema-generator": "^1.2.0",
"tslib": "^2.4.1"
"tslib": "^2.5.0"
},
"devDependencies": {
"@types/ffprobe": "^1.1.3"
"@types/ffprobe": "^1.1.4"
}
}
17 changes: 17 additions & 0 deletions common/models/src/apis/auth-api.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,23 @@
],
"additionalProperties": false
}
},
"OPTIONS": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"result": {},
"url": {},
"query": {},
"body": {},
"headers": {}
},
"required": [
"result"
],
"additionalProperties": false
}
}
},
"required": [
Expand Down
17 changes: 17 additions & 0 deletions common/models/src/apis/dashboard-api.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,23 @@
],
"additionalProperties": false
}
},
"OPTIONS": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"result": {},
"url": {},
"query": {},
"body": {},
"headers": {}
},
"required": [
"result"
],
"additionalProperties": false
}
}
},
"required": [
Expand Down
17 changes: 17 additions & 0 deletions common/models/src/apis/diag-api.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,23 @@
],
"additionalProperties": false
}
},
"OPTIONS": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"result": {},
"url": {},
"query": {},
"body": {},
"headers": {}
},
"required": [
"result"
],
"additionalProperties": false
}
}
},
"required": [
Expand Down
Loading