mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
feat: refine KAAK navigation and join experience
This commit is contained in:
1 parent
319a16f384
commit
458f95c2dc
21 files changed
+2017
-996
No files matched your search
Binary file not shown.
@@ -89,8 +89,9 @@
|
||||
<path d="M12 2v2m0 16v2M4.93 4.93l1.42 1.42m11.3 11.3 1.42 1.42M2 12h2m16 0h2M4.93 19.07l1.42-1.42m11.3-11.3 1.42-1.42" />
|
||||
</template>
|
||||
<path v-else-if="name === 'moon'" d="M20.4 15.2A8.5 8.5 0 0 1 8.8 3.6 8.5 8.5 0 1 0 20.4 15.2Z" />
|
||||
<path v-else-if="name === 'monitor'" d="M4 4h16v12H4zM8 20h8M12 16v4" />
|
||||
<path v-else-if="name === 'fullscreen'" d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" />
|
||||
<path v-else-if="name === 'monitor'" d="M4 4h16v12H4zM8 20h8M12 16v4" />
|
||||
<path v-else-if="name === 'translate'" fill="currentColor" stroke="none" d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.99-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.14 8.44 10 10.47 8 12.1c-1.31-1.08-2.39-2.39-3.2-3.91H2.8c.93 2.07 2.26 3.9 4.05 5.41l-3.74 3.71L4.5 18.7 8 15.2l2.18 2.18.69-2.31zm4.63-6.07h-2L11 22h2l1.12-3h4.75L20 22h2l-4.5-13zm-2.62 8 1.62-4.33L18.12 17h-3.24z" />
|
||||
<path v-else-if="name === 'fullscreen'" d="M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" />
|
||||
<path v-else-if="name === 'fullscreen-exit'" d="M9 4v5H4M20 9h-5V4M15 20v-5h5M4 15h5v5" />
|
||||
<path v-else-if="name === 'github'" fill="currentColor" stroke="none" d="M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56 0-.28-.01-1.02-.02-2-3.2.7-3.88-1.54-3.88-1.54-.53-1.33-1.28-1.68-1.28-1.68-1.04-.71.08-.7.08-.7 1.15.08 1.75 1.18 1.75 1.18 1.02 1.75 2.68 1.24 3.33.95.1-.74.4-1.24.73-1.52-2.55-.29-5.23-1.28-5.23-5.68 0-1.25.45-2.27 1.18-3.07-.12-.29-.51-1.45.11-3.03 0 0 .96-.31 3.15 1.17.91-.25 1.88-.38 2.85-.38.97 0 1.94.13 2.85.38 2.19-1.48 3.15-1.17 3.15-1.17.62 1.58.23 2.74.11 3.03.73.8 1.18 1.82 1.18 3.07 0 4.41-2.69 5.38-5.25 5.67.41.35.78 1.04.78 2.1 0 1.52-.01 2.75-.01 3.12 0 .3.21.67.8.56C20.71 21.39 24 17.08 24 12 24 5.65 18.35.5 12 .5Z" />
|
||||
<template v-else-if="name === 'qq'">
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
:aria-controls="menuId"
|
||||
@click.stop="toggle"
|
||||
>
|
||||
<Icon class="language-current-icon" name="translate" :size="24" />
|
||||
<span class="language-current-flag" aria-hidden="true">{{ currentLanguage.flag }}</span>
|
||||
<span class="language-current-code">{{ currentLanguage.code }}</span>
|
||||
<Icon name="chevron-down" :size="13" />
|
||||
@@ -130,12 +131,12 @@ onUnmounted(() => document.removeEventListener("pointerdown", onDocumentPointerD
|
||||
box-shadow: 0 7px 16px rgba(0, 106, 100, .16);
|
||||
}
|
||||
|
||||
.language-trigger .ui-icon {
|
||||
.language-trigger > .ui-icon:last-child {
|
||||
margin-left: auto;
|
||||
transition: transform .16s;
|
||||
}
|
||||
|
||||
.language-switcher.open .language-trigger .ui-icon {
|
||||
.language-switcher.open .language-trigger > .ui-icon:last-child {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
@@ -145,6 +146,10 @@ onUnmounted(() => document.removeEventListener("pointerdown", onDocumentPointerD
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.language-current-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.language-current-flag {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
@@ -169,21 +169,26 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<details
|
||||
class="identity-options"
|
||||
data-ws-part="home.identity"
|
||||
><summary>{{ t("identityOptions") }}</summary
|
||||
><label
|
||||
class="field-label"
|
||||
data-ws-part="home.field-label"
|
||||
for="channel"
|
||||
>{{ t("targetChannel") }} <span>{{ t("optional") }}</span></label
|
||||
><div class="field-wrap" data-ws-part="home.field"><Icon name="hash" :size="17" /><input
|
||||
<label
|
||||
class="field-label"
|
||||
data-ws-part="home.field-label"
|
||||
for="channel"
|
||||
>{{ t("targetChannel") }} <span>{{ t("optional") }}</span></label
|
||||
>
|
||||
<div class="field-wrap" data-ws-part="home.field">
|
||||
<Icon name="hash" :size="17" />
|
||||
<input
|
||||
id="channel"
|
||||
v-model="channel"
|
||||
:placeholder="t('emptyDefault')"
|
||||
@keyup.enter="emit('connect')"
|
||||
/></div
|
||||
/>
|
||||
</div>
|
||||
|
||||
<details
|
||||
class="identity-options"
|
||||
data-ws-part="home.identity"
|
||||
><summary>{{ t("identityOptions") }}</summary
|
||||
><div class="identity-controls"
|
||||
><label class="remember-identity"
|
||||
><input
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
<div
|
||||
class="modal-backdrop channel-password-backdrop"
|
||||
data-ws-part="auth.password.backdrop"
|
||||
data-ws-state="server-password"
|
||||
@click.self="emit('cancel')"
|
||||
>
|
||||
<section
|
||||
class="channel-password-modal server-password-modal"
|
||||
data-ws-part="auth.password.dialog"
|
||||
data-ws-state="server-password"
|
||||
ref="dialog"
|
||||
tabindex="-1"
|
||||
@keydown="onDialogKeydown"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
:avatar-style="avatarStyle"
|
||||
:avatar-initial="avatarInitial"
|
||||
:is-speaking="isSpeaking"
|
||||
:is-screen-sharing="isScreenSharing"
|
||||
:show-member-actions="showMemberActions"
|
||||
:member-drag-drop="memberDragDrop"
|
||||
:dragged-member-id="draggedMemberId"
|
||||
@@ -58,6 +59,7 @@ const props = defineProps<{
|
||||
avatarStyle: (name: string, isSelf?: boolean, avatar?: string) => CSSProperties;
|
||||
avatarInitial: (name: string) => string;
|
||||
isSpeaking: (member: ChannelMember) => boolean;
|
||||
isScreenSharing?: (member: ChannelMember) => boolean;
|
||||
showMemberActions?: boolean;
|
||||
memberDragDrop?: boolean;
|
||||
draggedMemberId?: number | null;
|
||||
|
||||
@@ -89,6 +89,14 @@
|
||||
:size="13"
|
||||
:title="t('microphoneActive')"
|
||||
/>
|
||||
<span
|
||||
v-if="isScreenSharing?.(member)"
|
||||
class="ws-voice-channel-member-screen-share"
|
||||
data-ws-part="voice.channel-tree.member-screen-share"
|
||||
role="img"
|
||||
:aria-label="t('screenShare')"
|
||||
:title="t('screenShare')"
|
||||
><Icon name="monitor" :size="12" /></span>
|
||||
</li>
|
||||
</ul>
|
||||
<div
|
||||
@@ -110,6 +118,7 @@
|
||||
:avatar-style="avatarStyle"
|
||||
:avatar-initial="avatarInitial"
|
||||
:is-speaking="isSpeaking"
|
||||
:is-screen-sharing="isScreenSharing"
|
||||
:show-member-actions="showMemberActions"
|
||||
:member-drag-drop="memberDragDrop"
|
||||
:dragged-member-id="draggedMemberId"
|
||||
@@ -176,6 +185,14 @@
|
||||
aria-hidden="true"
|
||||
></span>
|
||||
<span v-if="member.away" class="ws-voice-channel-member-away" data-ws-part="voice.channel-tree.member-away" aria-hidden="true">·</span>
|
||||
<span
|
||||
v-if="isScreenSharing?.(member)"
|
||||
class="ws-voice-channel-member-screen-share"
|
||||
data-ws-part="voice.channel-tree.member-screen-share"
|
||||
role="img"
|
||||
:aria-label="t('screenShare')"
|
||||
:title="t('screenShare')"
|
||||
><Icon name="monitor" :size="12" /></span>
|
||||
</li>
|
||||
<VoiceChannelTreeItem
|
||||
v-for="child in node.children"
|
||||
@@ -189,6 +206,7 @@
|
||||
:avatar-style="avatarStyle"
|
||||
:avatar-initial="avatarInitial"
|
||||
:is-speaking="isSpeaking"
|
||||
:is-screen-sharing="isScreenSharing"
|
||||
:show-member-actions="showMemberActions"
|
||||
:member-drag-drop="memberDragDrop"
|
||||
:dragged-member-id="draggedMemberId"
|
||||
@@ -228,6 +246,7 @@ const props = defineProps<{
|
||||
avatarStyle: (name: string, isSelf?: boolean, avatar?: string) => CSSProperties;
|
||||
avatarInitial: (name: string) => string;
|
||||
isSpeaking: (member: ChannelMember) => boolean;
|
||||
isScreenSharing?: (member: ChannelMember) => boolean;
|
||||
showMemberActions?: boolean;
|
||||
memberDragDrop?: boolean;
|
||||
draggedMemberId?: number | null;
|
||||
@@ -282,3 +301,18 @@ function handleChannelDrop(event: DragEvent): void {
|
||||
if (props.memberDragDrop) emit("channelDrop", { channel: props.node.channel, event });
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ws-voice-channel-member-screen-share {
|
||||
display: inline-grid;
|
||||
box-sizing: border-box;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
flex: 0 0 18px;
|
||||
place-items: center;
|
||||
border-radius: 5px;
|
||||
color: #fff;
|
||||
background: #72c800;
|
||||
line-height: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -26,6 +26,8 @@ export const webClientTranslations: Record<string, Record<string, string>> = {
|
||||
notConfigured: "WebSpeak 尚未配置 TeamSpeak 目标。",
|
||||
configureNow: "打开管理控制台",
|
||||
privateAudio: "私密社区语音",
|
||||
mytsLogin: "使用myts登录",
|
||||
featureInDevelopment: "这个功能还在开发中",
|
||||
joinLine1: "连接服务器,",
|
||||
joinLine2: "马上开始交流。",
|
||||
joinDescription: "无需安装 TeamSpeak 客户端,打开浏览器即可加入语音频道。低延迟、轻量、专注于每一次对话。",
|
||||
@@ -439,6 +441,8 @@ export const webClientTranslations: Record<string, Record<string, string>> = {
|
||||
notConfigured: "The WebSpeak TeamSpeak target has not been configured.",
|
||||
configureNow: "Open admin console",
|
||||
privateAudio: "Private community audio",
|
||||
mytsLogin: "Sign in with myTS",
|
||||
featureInDevelopment: "This feature is still in development.",
|
||||
joinLine1: "Connect to your server,",
|
||||
joinLine2: "start the conversation.",
|
||||
joinDescription: "No TeamSpeak client installation required. Open your browser and join a voice channel with low-latency audio built for conversation.",
|
||||
|
||||
@@ -46,10 +46,10 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
|
||||
{
|
||||
id: BUILTIN_KAAK_SKIN_ID,
|
||||
name: "KAAK",
|
||||
version: "3.1.79",
|
||||
version: "3.1.86",
|
||||
author: "WebSpeak Project",
|
||||
license: "AGPL-3.0-only",
|
||||
description: "A KOOK-inspired voice-room workspace with a searchable server header, TeamSpeak banner and welcome message, nested channel members, attached channel chat, and a compact WebSpeak audio dock.",
|
||||
description: "A KOOK-inspired WebSpeak skin with a split-screen connection home, searchable server header, TeamSpeak banner, nested channel members, attached channel chat, and a compact audio dock.",
|
||||
minAppVersion: "0.2.7-preview",
|
||||
installedAt: 0,
|
||||
builtIn: true,
|
||||
|
||||
@@ -479,7 +479,7 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
|
||||
const file = new File([archive], "kaak-voice.wskin", { type: "application/octet-stream" });
|
||||
const skin = await importSkinPack(file);
|
||||
assert.equal(skin.id, "community.kaak-voice");
|
||||
assert.equal(skin.version, "3.1.79");
|
||||
assert.equal(skin.version, "3.1.86");
|
||||
assert.equal(BUILTIN_SKIN_CATALOG.find((entry) => entry.id === skin.id)?.version, skin.version);
|
||||
assert.equal(skin.schemaVersion, 3);
|
||||
const home = skin.pluginData?.components.find((component) => component.page === "home");
|
||||
@@ -510,9 +510,14 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
|
||||
for (const child of node.children ?? []) {
|
||||
const found = findPart(child, part);
|
||||
if (found) return found;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
assert.equal(findPart(home?.root, "home-language")?.widget, "app.language-switcher", "the KAAK connection home has a language switcher in its top corner");
|
||||
assert.equal(findPart(voice?.root, "topbar"), undefined, "the KAAK voice surface has no top bar");
|
||||
assert.equal(findPart(voice?.root, "rail-skin")?.widget, "app.skin-switcher", "skin selection lives in the server rail");
|
||||
assert.equal(findPart(voice?.root, "rail-language")?.widget, "app.language-switcher", "language selection lives in the server rail");
|
||||
assert.equal(findPart(voice?.root, "server-list")?.children?.[0]?.repeat?.path, "servers.quickList");
|
||||
assert.deepEqual(findPart(voice?.root, "member-cards")?.options, { screenShare: true, memberActions: true });
|
||||
assert.equal(findPart(voice?.root, "server-summary")?.widget, "voice.server-header");
|
||||
assert.equal(findPart(voice?.root, "server-banner")?.widget, "voice.server-banner");
|
||||
@@ -586,9 +591,13 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
|
||||
assert.match(skin.css, /--skin-kaak-accent: #6cbf00;/);
|
||||
assert.match(skin.css, /\[data-ws-part="auth\.password\.backdrop"\]\s*\{[^}]*background: rgba\(10, 11, 13, \.54\);/);
|
||||
assert.match(skin.css, /\[data-ws-part="auth\.password\.dialog"\]\s*\{[^}]*width: min\(438px, calc\(100vw - 32px\)\);[^}]*min-height: 204px;[^}]*background: #242529;/);
|
||||
assert.match(skin.css, /\[data-ws-part="auth\.password\.dialog"\]\[data-ws-state="server-password"\]\s*\{[^}]*color: #273248;[^}]*border-color: #e3e8ec;[^}]*background: #fff;/);
|
||||
assert.match(skin.css, /\[data-ws-part="auth\.password\.title"\]\s*\{[^}]*font-size: 13px;[^}]*font-weight: 700;/);
|
||||
assert.match(skin.css, /\[data-ws-part="auth\.password\.field"\]\s*\{[^}]*height: 40px;[^}]*border: 1px solid #3b3c40;[^}]*border-radius: 12px;/);
|
||||
assert.match(skin.css, /\[data-ws-part="home\.form"\] \[data-ws-part="home\.field"\]:has\(input\[type="password"\]\)\s*\{[^}]*height: 40px;[^}]*border-radius: 12px;[^}]*background: #242529;/);
|
||||
assert.match(skin.css, /auth\.password\.dialog"\]\[data-ws-state="server-password"\][\s\S]*?auth\.password\.field"\]\s*\{[^}]*border-color: #e3e8ec;[^}]*background: #fff;/);
|
||||
assert.match(skin.css, /auth\.password\.dialog"\]\[data-ws-state="server-password"\][\s\S]*?input:-webkit-autofill[\s\S]*?-webkit-box-shadow: 0 0 0 1000px #fff inset;/);
|
||||
assert.match(skin.css, /\[data-ws-part="home\.form"\] \[data-ws-part="home\.field"\]:has\(input\[type="password"\]\)\s*\{[^}]*height: 42px;[^}]*border-radius: 11px;[^}]*background: #fff;/);
|
||||
assert.match(skin.css, /home\.field"\]:has\(input\[type="password"\]\) input:-webkit-autofill[\s\S]*?-webkit-box-shadow: 0 0 0 1000px #fff inset;[\s\S]*?-webkit-text-fill-color: #273248;/);
|
||||
assert.match(skin.css, /\[data-ws-part="auth\.password\.actions"\] > button:last-child\s*\{[^}]*width: 82px;[^}]*height: 36px;[^}]*background: #6cbf00;/);
|
||||
assert.match(skin.css, /\[data-ws-plugin-part="kaak-workspace\.voice-dock"\] \{[\s\S]*?width: min\(282px, calc\(100% - 22px\)\);[\s\S]*?margin-bottom: 11px;[\s\S]*?border-radius: 17px;/);
|
||||
assert.match(skin.css, /\[data-ws-plugin-part="kaak-workspace\.voice-dock-actions"\] \{[\s\S]*?grid-template-columns: minmax\(0, 1fr\) 28px 28px 36px;[\s\S]*?grid-template-rows: 29px 26px;[\s\S]*?row-gap: 21px;/);
|
||||
@@ -634,7 +643,9 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
|
||||
assert.match(skin.css, /\.settings-select:hover:not\(:disabled\) \{\s*border-color: #6cbf00;/);
|
||||
assert.match(skin.css, /\.microphone-toggle:not\(\.muted\):active,[\s\S]*?background: #60ab00;\s*border-color: #60ab00;/);
|
||||
assert.doesNotMatch(skin.css, /#58c877/);
|
||||
assert.match(skin.css, /\[data-ws-plugin-part="kaak-home"\] \{[^}]*font-family: var\(--skin-kaak-font\);/);
|
||||
assert.match(skin.css, /\[data-ws-plugin-part="kaak-home"\] \{[^}]*font-family: Arial, "Microsoft YaHei", sans-serif;/);
|
||||
assert.match(skin.css, /\.kaak-myts-login\s*\{[^}]*width: 60px;[^}]*height: 60px;[^}]*background: transparent;[^}]*clip-path: polygon\(0 0, 100% 0, 100% 100%\);/);
|
||||
assert.match(skin.css, /\.kaak-myts-wordmark\s*\{[^}]*color: #fff;[^}]*transform: rotate\(45deg\);/);
|
||||
assert.match(skin.css, /settings-select-menu[\s\S]*?background: #25262a/);
|
||||
assert.match(skin.css, /settings-select-option[\s\S]*?min-height: 32px/);
|
||||
assert.match(skin.css, /settings-header h2 \{\s*color: #f2f3f5;\s*font-size: 32px;\s*font-weight: 600;/);
|
||||
@@ -668,9 +679,23 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
|
||||
assert.match(skin.css, /grid-template-columns: 86px 304px minmax\(280px, 1fr\) 0;/);
|
||||
assert.match(skin.css, /grid-template-columns: 86px 304px/);
|
||||
assert.match(skin.css, /minmax\(340px, min\(38vw, 520px\)\)/);
|
||||
assert.match(skin.css, /grid-template-rows: 40px/);
|
||||
assert.match(skin.css, /grid-template-rows: minmax\(0, 1fr\)/);
|
||||
assert.doesNotMatch(skin.css, /kaak-workspace\.topbar/);
|
||||
assert.match(skin.css, /kaak-workspace\.server-rail"\]\s*\{[\s\S]*?--skin-kaak-rail-bg: #191a1d;[\s\S]*?--skin-kaak-rail-item-bg: #2b2d32;[\s\S]*?--skin-kaak-rail-accent: #75c900;[\s\S]*?gap: 18px;[\s\S]*?padding: 14px 0 96px;[\s\S]*?background: var\(--skin-kaak-rail-bg\);/);
|
||||
assert.match(skin.css, /kaak-workspace\.server-add"\]\s*\{[\s\S]*?width: 58px;[\s\S]*?height: 58px;[\s\S]*?border-radius: 18px;/);
|
||||
assert.match(skin.css, /kaak-workspace\.rail-skin"\]\s*\{[\s\S]*?width: 58px;[\s\S]*?height: 58px;[\s\S]*?flex: 0 0 58px;/);
|
||||
assert.match(skin.css, /kaak-workspace\.rail-language"\]\s*\{[\s\S]*?order: 4;[\s\S]*?width: 58px;[\s\S]*?height: 58px;[\s\S]*?flex: 0 0 58px;/);
|
||||
assert.match(skin.css, /rail-language"\] \.language-trigger\s*\{[^}]*width: 58px;[^}]*height: 58px;[^}]*border-radius: 18px;[^}]*background: var\(--skin-kaak-rail-item-bg\);/);
|
||||
assert.match(skin.css, /rail-language"\] \.language-trigger > \.language-current-icon\s*\{\s*display: block;[^}]*width: 24px;[^}]*height: 24px;/);
|
||||
assert.match(skin.css, /kaak-home\.home-language"\]\s*\{[^}]*position: fixed;[^}]*top: 18px;[^}]*right: 18px;/);
|
||||
assert.match(skin.css, /kaak-home\.home-language"\] \.language-trigger\s*\{[^}]*width: 48px;[^}]*height: 48px;[^}]*background: #fff;/);
|
||||
assert.match(skin.css, /kaak-home\.home-language"\] \.language-trigger > \.language-current-icon\s*\{\s*display: block;/);
|
||||
assert.doesNotMatch(skin.css, /language-trigger::before\s*\{\s*content: "文\/A";/);
|
||||
assert.match(skin.css, /skin-add-divider"\]\s*\{\s*order: 1;/);
|
||||
assert.match(skin.css, /kaak-workspace\.server-add"\]\s*\{\s*order: 2;/);
|
||||
assert.match(skin.css, /kaak-workspace\.rail-skin"\]\s*\{\s*order: 3;/);
|
||||
assert.match(skin.css, /rail-language"\] \.language-dropdown\s*\{[^}]*position: fixed;[^}]*bottom: 161px;[^}]*left: 94px;/);
|
||||
assert.match(skin.css, /rail-skin"\] \.skin-dropdown\s*\{[^}]*position: fixed;[^}]*bottom: 179px;[^}]*left: 94px;/);
|
||||
assert.match(skin.css, /kaak-workspace\.quick-server-item"\]\s*\{[\s\S]*?width: 58px;[\s\S]*?height: 58px;/);
|
||||
assert.match(skin.css, /kaak-workspace\.quick-server"\]\s*\{[\s\S]*?width: 58px;[\s\S]*?height: 58px;[\s\S]*?border: 2px solid transparent;[\s\S]*?border-radius: 18px;/);
|
||||
assert.match(skin.css, /quick-server\"\]\:hover[\s\S]*?background: #383a40;/);
|
||||
|
||||
@@ -1740,10 +1740,19 @@ const skinPluginActions = {
|
||||
if (!voiceState.connected || typeof args.streamId !== "string") return;
|
||||
if (screenShareStreams.some((stream) => stream.streamId === args.streamId)) joinScreenShare(args.streamId);
|
||||
},
|
||||
"voice.leaveScreenShare": () => { if (screenShareViewing.value) leaveScreenShare(); },
|
||||
};
|
||||
|
||||
const skinPluginWidgets = {
|
||||
"voice.leaveScreenShare": () => { if (screenShareViewing.value) leaveScreenShare(); },
|
||||
};
|
||||
|
||||
const homeConnectionStatus = computed(() => {
|
||||
if (voiceState.connecting) return t("connecting");
|
||||
if (voiceState.error) return localizedMessage(voiceState.error);
|
||||
if (browserError.value) return localizedMessage(browserError.value);
|
||||
if (!serverConfigLoading.value && !initialized.value) return t("notConfigured");
|
||||
if (!localPersistenceAvailable) return t("localPersistenceUnavailable");
|
||||
return "";
|
||||
});
|
||||
|
||||
const skinPluginWidgets = {
|
||||
"voice.screen-share-start": () => h("button", {
|
||||
type: "button",
|
||||
class: "skin-runtime-screen-share-start",
|
||||
@@ -1784,10 +1793,21 @@ const skinPluginWidgets = {
|
||||
onSelectServer: selectLocalServer,
|
||||
onToggleFavorite: toggleFavorite,
|
||||
onToggleQuickFavorite: toggleQuickFavorite,
|
||||
onImportIdentity: openIdentityImport,
|
||||
onExportIdentity: exportIdentity,
|
||||
}),
|
||||
"app.skin-switcher": () => h(SkinSwitcher, {
|
||||
onImportIdentity: openIdentityImport,
|
||||
onExportIdentity: exportIdentity,
|
||||
}),
|
||||
"home.connection-status": () => h("p", {
|
||||
class: "kaak-home-status",
|
||||
role: "status",
|
||||
"aria-live": "polite",
|
||||
}, homeConnectionStatus.value),
|
||||
"home.myts-login": () => h("button", {
|
||||
type: "button",
|
||||
class: "kaak-myts-login",
|
||||
"aria-label": t("mytsLogin"),
|
||||
onClick: () => showToast(t("featureInDevelopment")),
|
||||
}, [h("span", { class: "kaak-myts-wordmark", "aria-hidden": "true" }, "myts")]),
|
||||
"app.skin-switcher": () => h(SkinSwitcher, {
|
||||
modelValue: activeSkinId.value,
|
||||
"onUpdate:modelValue": (value: string) => { activeSkinId.value = value; },
|
||||
class: "skin-switcher",
|
||||
@@ -1841,6 +1861,7 @@ const skinPluginWidgets = {
|
||||
avatarStyle,
|
||||
avatarInitial,
|
||||
isSpeaking,
|
||||
isScreenSharing: (member: ChannelMember) => Boolean(screenShareControls.streamForMember(member)),
|
||||
showMemberActions: options?.memberActions === true,
|
||||
memberDragDrop: options?.memberDragDrop === true,
|
||||
draggedMemberId: memberControls.draggedMember.value?.id ?? null,
|
||||
|
||||
@@ -6,12 +6,13 @@ import vue from "@vitejs/plugin-vue";
|
||||
import { createServer } from "vite";
|
||||
import { createRenderer, createSSRApp, nextTick, shallowRef, markRaw } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
let vite, useWebClientScreenShare, VoiceMemberCards;
|
||||
let vite, useWebClientScreenShare, VoiceMemberCards, VoiceChannelTree;
|
||||
const renderer = createRenderer({ createComment: text => ({ text }), createText: text => ({ text }), createElement: () => ({}), insert() {}, remove() {}, setText() {}, setElementText() {}, patchProp() {}, parentNode: () => null, nextSibling: () => null });
|
||||
before(async () => {
|
||||
vite = await createServer({ configFile: false, plugins: [vue()], root: fileURLToPath(new URL("../", import.meta.url)), server: { middlewareMode: true, hmr: false, ws: false, watch: null }, optimizeDeps: { noDiscovery: true, include: [] }, appType: "custom" });
|
||||
({ useWebClientScreenShare } = await vite.ssrLoadModule("/src/composables/useWebClientScreenShare.ts"));
|
||||
({ default: VoiceMemberCards } = await vite.ssrLoadModule("/src/components/web-client/VoiceMemberCards.vue"));
|
||||
({ default: VoiceChannelTree } = await vite.ssrLoadModule("/src/components/web-client/VoiceChannelTree.vue"));
|
||||
});
|
||||
after(async () => { await vite?.close(); });
|
||||
function mount(t, initialStream = null) {
|
||||
@@ -125,6 +126,34 @@ test("member cards detect and expose a remote share without depending on local s
|
||||
assert.doesNotMatch(html, /startScreenShare/);
|
||||
});
|
||||
|
||||
test("channel tree marks only members who own an active screen share", async () => {
|
||||
const component = await readFile(new URL("../src/components/web-client/VoiceChannelTreeItem.vue", import.meta.url), "utf8");
|
||||
const html = await renderToString(createSSRApp(VoiceChannelTree, {
|
||||
channels: [{
|
||||
id: "channel-1",
|
||||
parentID: "0",
|
||||
depth: 0,
|
||||
name: "General",
|
||||
members: [
|
||||
{ id: 7, nickname: "MeissS" },
|
||||
{ id: 8, nickname: "NoShare" },
|
||||
],
|
||||
}],
|
||||
currentChannelId: "channel-1",
|
||||
layout: "server-sidebar",
|
||||
avatarStyle: () => ({}),
|
||||
avatarInitial: nickname => nickname[0],
|
||||
isSpeaking: () => false,
|
||||
isScreenSharing: member => member.id === 7,
|
||||
t: key => key,
|
||||
}));
|
||||
|
||||
assert.equal((html.match(/data-ws-part="voice\.channel-tree\.member-screen-share"/g) ?? []).length, 1);
|
||||
assert.match(html, /aria-label="screenShare"/);
|
||||
assert.match(html, /d="M4 4h16v12H4zM8 20h8M12 16v4"/);
|
||||
assert.match(component, /background:\s*#72c800/);
|
||||
});
|
||||
|
||||
test("a skin can explicitly opt the member-card widget out of screen-share UI", async () => {
|
||||
const html = await renderToString(createSSRApp(VoiceMemberCards, {
|
||||
currentMembers: [{ id: 7, nickname: "Remote sharer", isSelf: false, inputMuted: false }],
|
||||
|
||||
Reference in new issue
Block a user