Skip to content

Commit

Permalink
[webapp] Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
mantou132 committed Dec 23, 2023
1 parent b0287d1 commit 1088a05
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"editor.formatOnSave": false
},
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
"[rust]": {
"editor.tabSize": 4,
Expand Down
4 changes: 2 additions & 2 deletions packages/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
"prepublishOnly": "npm run build"
},
"dependencies": {
"@mantou/gem": "^1.6.19",
"@mantou/gem": "^1.7.4",
"@mantou/nes": "^1.0.14",
"@mantou/nes-sandbox": "^0.0.13",
"@nesbox/arcade": "^0.0.1",
"@nesbox/fceux": "^0.0.1",
"@nesbox/mtapp": "^0.0.1",
"@nesbox/wasm4": "^0.0.1",
"duoyun-ui": "^0.0.65",
"duoyun-ui": "^1.1.4",
"front-matter": "^4.0.2",
"graphql": "^16.2.0",
"jszip": "^3.10.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class AppRootElement extends GemElement {
<dy-modal
customize
@close=${toggleSearchState}
.maskCloseable=${true}
.maskClosable=${true}
.open=${!!configure.searchState}
.body=${html`<m-search></m-search>`}
>
Expand Down
29 changes: 0 additions & 29 deletions packages/webapp/src/effects/wake-lock.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/webapp/src/icons.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { raw } from '@mantou/gem';
import { setIcons } from 'duoyun-ui/lib/icons';
import { extendIcons } from 'duoyun-ui/lib/icons';

function genIcon(d: string, ext = '') {
return raw`
Expand All @@ -22,7 +22,7 @@ function genIconV2(d: string, ext = '', viewBox = '0 0 960 960') {
}

// https://fonts.google.com/icons?icon.style=Rounded&icon.set=Material+Symbols
export const icons = setIcons({
export const icons = extendIcons({
screenRecord: genIconV2(
'M159 813q-37-51-58-110.5T80 576q0-67 20.5-127T158 339l43 43q-29 42-45 91t-16 103q0 54 16.5 103.5T202 771l-43 42Zm321 163q-66 0-126.5-20.5T243 898l43-43q42 29 91 45t103 16q54 0 103-16t91-45l43 43q-50 37-110 57.5T480 976Zm322-162-43-43q29-42 45-91.5T820 576q0-54-16-103t-45-91l43-43q37 50 57.5 110T880 576q0 67-20.5 127T802 814ZM285 297l-43-43q51-37 111-57.5T480 176q67 0 127 21t111 58l-43 43q-42-29-91-45.5T480 236q-54 0-103.5 16T285 297Zm195 469q-79 0-134.5-55.5T290 576q0-79 55.5-134.5T480 386q79 0 134.5 55.5T670 576q0 79-55.5 134.5T480 766Z',
'',
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/src/modules/avatar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GemElement, html, adoptedStyle, customElement, createCSSSheet, css, connectStore } from '@mantou/gem';
import { ContextMenu } from 'duoyun-ui/elements/menu';
import { ContextMenu } from 'duoyun-ui/elements/contextmenu';
import { waitLoading } from 'duoyun-ui/elements/wait';
import { commonHandle } from 'duoyun-ui/lib/hotkeys';
import { Modal } from 'duoyun-ui/elements/modal';
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/src/modules/friend-item.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GemElement, html, adoptedStyle, customElement, createCSSSheet, css, property } from '@mantou/gem';
import { ContextMenu } from 'duoyun-ui/elements/menu';
import { ContextMenu } from 'duoyun-ui/elements/contextmenu';
import { commonHandle } from 'duoyun-ui/lib/hotkeys';

import { getAvatar } from 'src/utils/common';
Expand Down
8 changes: 4 additions & 4 deletions packages/webapp/src/modules/game-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { icons } from 'src/icons';
import 'duoyun-ui/elements/heading';
import 'duoyun-ui/elements/divider';
import 'duoyun-ui/elements/select';
import 'duoyun-ui/elements/pick';
import 'duoyun-ui/elements/picker';
import 'duoyun-ui/elements/use';
import 'src/modules/game-item';

Expand All @@ -37,7 +37,7 @@ const style = createCSSSheet(css`
margin-block: 0;
}
dy-select,
dy-pick {
dy-picker {
width: 8em;
padding-block: 0;
border: none;
Expand Down Expand Up @@ -228,13 +228,13 @@ export class MGameListElement extends GemElement {
.options=${gameKindList.map((e) => ({ ...e, label: i18n.get(e.label) }))}
@change=${this.#onChangeKind}
></dy-select>
<dy-pick
<dy-picker
.placeholder=${i18n.get('page.game.series')}
.value=${this.#gameSeries}
.options=${gameSeriesList.map((e) => ({ ...e, label: i18n.get(e.label) }))}
@change=${({ detail }: CustomEvent<ScGameSeries | ''>) =>
changeQuery(queryKeys.GAME_SERIES, detail)}
></dy-pick>
></dy-picker>
<dy-select
.dropdownStyle=${{ width: '8em' }}
.placeholder=${i18n.get('page.game.maxPlayer')}
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/src/modules/guest.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GemElement, html, adoptedStyle, customElement, createCSSSheet, css, connectStore } from '@mantou/gem';
import { icons } from 'duoyun-ui/lib/icons';
import { commonHandle } from 'duoyun-ui/lib/hotkeys';
import { ContextMenu } from 'duoyun-ui/elements/menu';
import { ContextMenu } from 'duoyun-ui/elements/contextmenu';
import { waitLoading } from 'duoyun-ui/elements/wait';
import { focusStyle } from 'duoyun-ui/lib/styles';

Expand Down
14 changes: 7 additions & 7 deletions packages/webapp/src/modules/new-game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { GameAttributes, store } from 'src/store';

import 'duoyun-ui/elements/alert';
import 'duoyun-ui/elements/link';
import 'duoyun-ui/elements/pick';
import 'duoyun-ui/elements/picker';
import 'duoyun-ui/elements/input';
import 'duoyun-ui/elements/button';
import 'duoyun-ui/elements/paragraph';
Expand Down Expand Up @@ -136,33 +136,33 @@ export class MNewGameElement extends GemElement<State> {
></dy-input>
</dy-input-group>
<dy-input-group>
<dy-pick
<dy-picker
.value=${maxPlayer ?? undefined}
.placeholder=${i18n.get('page.game.maxPlayer')}
.options=${['', '1', '2', '4'].map((value) => ({
value: value && `game.max_player.${value}`,
label: value ? i18n.get('page.game.player', value) : i18n.get('global.noLimit'),
}))}
@change=${({ detail }: CustomEvent<string>) => this.setState({ maxPlayer: detail })}
></dy-pick>
<dy-pick
></dy-picker>
<dy-picker
.value=${kind ?? undefined}
.placeholder=${i18n.get('page.game.kind')}
.options=${gameKindList.map((e) => ({
value: e.value && `game.kind.${e.value.toLowerCase()}`,
label: i18n.get(e.label),
}))}
@change=${({ detail }: CustomEvent<string>) => this.setState({ kind: detail })}
></dy-pick>
<dy-pick
></dy-picker>
<dy-picker
.value=${series ?? undefined}
.placeholder=${i18n.get('page.game.series')}
.options=${gameSeriesList.map((e) => ({
value: e.value && `game.series.${e.value.toLowerCase()}`,
label: i18n.get(e.label),
}))}
@change=${({ detail }: CustomEvent<string>) => this.setState({ series: detail })}
></dy-pick>
></dy-picker>
</dy-input-group>
`;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/src/modules/room-player-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from '@mantou/gem';
import { commonHandle } from 'duoyun-ui/lib/hotkeys';
import { focusStyle } from 'duoyun-ui/lib/styles';
import { ContextMenu } from 'duoyun-ui/elements/menu';
import { ContextMenu } from 'duoyun-ui/elements/contextmenu';
import { isNotBoolean } from 'duoyun-ui/lib/types';
import { Player } from '@mantou/nes';

Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/src/modules/room-recorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class MRoomRecorderElement extends GemElement<State> {
return html`
<nesbox-tooltip
.content=${recorder ? i18n.get('tooltip.game.stopRecord') : i18n.get('tooltip.game.startRecord')}
position="left"
position="topRight"
>
<dy-use
class=${classMap({ recording: !!recorder })}
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/src/modules/room-voice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export class MVoiceRoomElement extends GemElement<State> {
return html`
<nesbox-tooltip
.content=${joined ? i18n.get('tooltip.room.stopVoice') : i18n.get('tooltip.room.startVoice')}
position="left"
position="topRight"
>
<dy-use class="icon" @click=${this.toggleVoice} .element=${joined ? icons.mic : icons.micOff}></dy-use>
</nesbox-tooltip>
Expand Down
18 changes: 9 additions & 9 deletions packages/webapp/src/modules/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const style = createCSSSheet(css`
.tabs::part(tab):hover {
color: currentColor;
}
.tabs::part(current-tab) {
.tabs::part(current) {
color: currentColor;
background-color: ${theme.hoverBackgroundColor};
border-radius: ${`${theme.normalRound} 0 0 ${theme.normalRound}`};
Expand Down Expand Up @@ -68,9 +68,9 @@ export class MSettingsElement extends GemElement<State> {
orientation="vertical"
@change=${this.#onChange}
.value=${this.state.tab}
.data=${[
.items=${[
{
tab: i18n.get('settings.keybinding.title'),
label: i18n.get('settings.keybinding.title'),
getContent() {
return html`
<dy-tab-panel>
Expand All @@ -80,7 +80,7 @@ export class MSettingsElement extends GemElement<State> {
},
},
{
tab: i18n.get('settings.shortcut.title'),
label: i18n.get('settings.shortcut.title'),
getContent() {
return html`
<dy-tab-panel>
Expand All @@ -90,7 +90,7 @@ export class MSettingsElement extends GemElement<State> {
},
},
{
tab: i18n.get('settings.sound.title'),
label: i18n.get('settings.sound.title'),
getContent() {
return html`
<dy-tab-panel>
Expand All @@ -100,7 +100,7 @@ export class MSettingsElement extends GemElement<State> {
},
},
{
tab: i18n.get('settings.video.title'),
label: i18n.get('settings.video.title'),
getContent() {
return html`
<dy-tab-panel>
Expand All @@ -110,7 +110,7 @@ export class MSettingsElement extends GemElement<State> {
},
},
{
tab: i18n.get('settings.ui.title'),
label: i18n.get('settings.ui.title'),
getContent() {
return html`
<dy-tab-panel>
Expand All @@ -120,7 +120,7 @@ export class MSettingsElement extends GemElement<State> {
},
},
{
tab: i18n.get('settings.account.title'),
label: i18n.get('settings.account.title'),
getContent() {
return html`
<dy-tab-panel>
Expand All @@ -130,7 +130,7 @@ export class MSettingsElement extends GemElement<State> {
},
},
{
tab: i18n.get('settings.license'),
label: i18n.get('settings.license'),
getContent() {
return html`
<dy-tab-panel>
Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/src/pages/favorites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { i18n } from 'src/i18n/basic';
import { theme } from 'src/theme';
import { getGameIds } from 'src/services/api';

import 'duoyun-ui/elements/carousel';
import 'duoyun-ui/elements/result';
import 'src/modules/game-list';

const style = createCSSSheet(css`
Expand Down
3 changes: 1 addition & 2 deletions packages/webapp/src/pages/games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const style = createCSSSheet(css`
image-rendering: pixelated;
}
.top::part(img) {
--mask-range: 0;
inset: 0 3em 0 auto;
margin: auto;
width: auto;
Expand Down Expand Up @@ -198,7 +197,7 @@ export class PGamesElement extends GemElement<State> {
<dy-carousel
class="top"
style=${styleMap({ backgroundColor: this.state.background, backgroundImage: this.state.backgroundImage })}
.data=${topData}
.items=${topData}
.interval=${7000}
@change=${({ detail }: CustomEvent<number>) => this.#onTopChange(detail, topData?.length)}
></dy-carousel>
Expand Down
6 changes: 2 additions & 4 deletions packages/webapp/src/pages/mt-room.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
GemElement,
html,
adoptedStyle,
customElement,
Expand All @@ -13,6 +12,7 @@ import {
import { createPath, matchPath } from 'duoyun-ui/elements/route';
import { waitLoading } from 'duoyun-ui/elements/wait';
import { routes } from 'src/routes';
import { DuoyunWakeLockBaseElement } from 'duoyun-ui/elements/base/wake-lock';

import { playHintSound } from 'src/utils/common';
import { globalEvents, queryKeys } from 'src/constants';
Expand All @@ -22,7 +22,6 @@ import { leaveRoom, updateRoomScreenshot } from 'src/services/api';
import { configure } from 'src/configure';
import { theme } from 'src/theme';
import { updateMtApp } from 'src/mt-app';
import { wakeLock } from 'src/effects/wake-lock';

import type { MStageElement } from 'src/modules/stage';
import type { MVoiceRoomElement } from 'src/modules/room-voice';
Expand Down Expand Up @@ -58,7 +57,7 @@ const style = createCSSSheet(css`
@connectStore(store)
@connectStore(configure)
@adoptedStyle(style)
export class PMtRoomElement extends GemElement {
export class PMtRoomElement extends DuoyunWakeLockBaseElement {
@refobject stageRef: RefObject<MStageElement>;
@refobject voiceRef: RefObject<MVoiceRoomElement>;

Expand Down Expand Up @@ -96,7 +95,6 @@ export class PMtRoomElement extends GemElement {
};

mounted = () => {
this.effect(wakeLock, () => []);
this.effect(
() => {
if (configure.user && !this.#playing) {
Expand Down
Loading

0 comments on commit 1088a05

Please sign in to comment.