diff --git a/docs/OPEN_SKIN_SYSTEM_SPEC.zh-CN.md b/docs/OPEN_SKIN_SYSTEM_SPEC.zh-CN.md index ff68f18..d0238a2 100644 --- a/docs/OPEN_SKIN_SYSTEM_SPEC.zh-CN.md +++ b/docs/OPEN_SKIN_SYSTEM_SPEC.zh-CN.md @@ -16,7 +16,7 @@ v3 自定义组件不是脚本插件。components.json schema v1 是既有格式;schema v2 增加 `mode: "surface"` 与宿主控件节点;schema v3 扩大自定义节点、嵌套、重复列表和声明式交互的边界,并增加映射到现有语音功能的动作。宿主仍解析固定元素/属性白名单、固定数据集合、简单绑定与有限动作,再由 Vue 创建节点。每个自定义组件根和每个有 DOM 的节点都会作为独立本地布局项,可移动、调整尺寸、改变外观或隐藏。节点指定 `part` 后使用该标识;未指定时使用树路径,树结构调整后旧的本地覆盖可能要重新设置。可操作节点保留至少 44 px 的触控目标。作者不必使用固定宿主控件目录,但 v3 仍不足以表达任意自定义 UI 逻辑和完整插件生命周期。管理员面板和演示页不能被 surface 替换。 -宿主控件通过固定 ID 嵌入,始终由 WebSpeak 代码运行。当前可选注册表包括 `home.connection-form`、`app.skin-switcher`、`app.language-switcher`、`voice.channel-panel`、`voice.member-cards`、`voice.chat-panel`、`voice.audio-controls`、`voice.screen-share-player`、`voice.screen-share-start`、`voice.whisper-controls`、`voice.performance-panel`、`voice.connection-controls` 和 `voice.disconnect-control`。每个控件在同一页面最多出现一次;未知 ID 或重复的有状态控件会拒绝导入。schema v3 的受保护控件会在导入时验证完整权限集合:音频控件要求 `audio.status.read`、`audio.microphone.control` 与 `audio.output.control`;聊天控件要求 `chat.channel.read` 与 `chat.channel.send`;成员卡片要求 `session.members.read` 及 `voice.screenShare.read`、`voice.screenShare.control`;屏幕共享播放器要求后两者;悄悄话控件要求 `voice.whisper.status.read` 与 `voice.whisper.control`;连接/断开控件要求 `voice.disconnect`。既有 schema v2 包仍按此前规则校验,`voice.screen-share-start` 则保留原有 `voice.screenShare.control` 要求。该控件仅限语音页;宿主按钮在可信点击处理器内直接开始屏幕采集,以保留浏览器要求的瞬时用户激活。作者可以不用这些控件,自行绘制界面并将点击、双击等事件绑定到公开数据与受权限保护的动作。 +宿主控件通过固定 ID 嵌入,始终由 WebSpeak 代码运行。当前可选注册表包括 `home.connection-form`、`app.skin-switcher`、`app.language-switcher`、`voice.channel-panel`、`voice.member-cards`、`voice.chat-panel`、`voice.audio-controls`、`voice.screen-share-player`、`voice.screen-share-start`、`voice.whisper-controls`、`voice.performance-panel`、`voice.connection-controls` 和 `voice.disconnect-control`。每个控件在同一页面最多出现一次;未知 ID 或重复的有状态控件会拒绝导入。schema v3 的受保护控件会在导入时验证完整权限集合:音频控件要求 `audio.status.read`、`audio.microphone.control` 与 `audio.output.control`;聊天控件要求 `chat.channel.read` 与 `chat.channel.send`;成员卡片要求 `session.members.read`、`session.memberAvatars.read` 及 `voice.screenShare.read`、`voice.screenShare.control`;头像只在可信宿主控件内显示,不暴露给皮肤代码;屏幕共享播放器要求后两者;悄悄话控件要求 `voice.whisper.status.read` 与 `voice.whisper.control`;连接/断开控件要求 `voice.disconnect`。既有 schema v2 包仍按此前规则校验,`voice.screen-share-start` 则保留原有 `voice.screenShare.control` 要求。该控件仅限语音页;宿主按钮在可信点击处理器内直接开始屏幕采集,以保留浏览器要求的瞬时用户激活。作者可以不用这些控件,自行绘制界面并将点击、双击等事件绑定到公开数据与受权限保护的动作。 v1-v3 包不能提交 HTML 字符串、事件处理代码、JavaScript、WebAssembly、远程脚本、任意 URL、表单导航、浏览器存储访问或网络调用。v4 可携带本地 JS/Wasm/CSS;JS 仍只校验和缓存,Wasm 在生产构建中经本地摘要授权后运行一次性有界任务,并经宿主解析、渲染动态 UI。运行时支持 `ui.surface.replace`、限定的公开只读数据权限和首版宿主动作效果;投影前由宿主按插件清单过滤字段,总快照最多 48 KiB,`ui_input_read` 输入最多 64 KiB。动作效果限于可信 UI 事件触发的同一轮调用、单个动作,并复用现有动作权限与参数校验。所有版本都拒绝未知协议字段、权限、动作和数据路径;v1-v3 拒绝未知节点/属性,v4 Wasm 输出则对标签名做语法验证、拒绝具备脚本/导航/嵌入能力的标签与属性,并将自定义标签惰性渲染为普通 `div`。 @@ -49,6 +49,7 @@ v4 当前运行路径已不使用 v3 固定标签/属性/状态/动作表来构 - session.status.read:连接状态、当前频道和显示名称。 - session.channels.read:公开频道树、频道名称、层级、人数和当前频道标志。 - session.members.read:可见成员名称、由名称派生的首字标记、所在频道、在线状态、说话状态及本人标志;不提供成员头像图像。 +- session.memberAvatars.read:允许可信 `voice.member-cards` 宿主控件显示当前可见成员的已缓存 TeamSpeak 头像;图像字节和 URL 不会传给皮肤声明树或 Wasm 插件上下文。 - chat.channel.read:当前公开文字频道中可见的消息。 - favorites.read:收藏项名称、类型、是否当前项和随机不透明本地令牌;不提供地址或凭据。 - servers.quickList.read:统一后的收藏和最近连接名称、当前项、分类与随机不透明本地令牌;不提供地址或凭据。 diff --git a/docs/SKIN_DEVELOPMENT.md b/docs/SKIN_DEVELOPMENT.md index 89747ef..833a8f6 100644 --- a/docs/SKIN_DEVELOPMENT.md +++ b/docs/SKIN_DEVELOPMENT.md @@ -148,7 +148,7 @@ components.json 顶层接受 schemaVersion 1、2 或 3 和 components 数组。s } ``` -当前可选宿主控件 ID:`home.connection-form`、`app.skin-switcher`、`app.language-switcher`、`voice.channel-panel`、`voice.member-cards`、`voice.chat-panel`、`voice.audio-controls`、`voice.screen-share-player`、`voice.screen-share-start`、`voice.whisper-controls`、`voice.performance-panel`、`voice.connection-controls`、`voice.disconnect-control`。未知控件和同页重复控件会被拒绝;每个控件的状态和业务动作仍由 WebSpeak 内部处理。schema v3 会检查受保护控件所需权限:音频控件需 `audio.status.read`、`audio.microphone.control` 和 `audio.output.control`;聊天需 `chat.channel.read` 与 `chat.channel.send`;成员卡片需 `session.members.read` 及屏幕共享读取/控制权限;屏幕共享播放器需 `voice.screenShare.read` 与 `voice.screenShare.control`;悄悄话控件需对应状态读取和控制权限;断开/连接控件需 `voice.disconnect`。既有 v2 包维持旧校验行为,`voice.screen-share-start` 仍像此前一样要求 `voice.screenShare.control`。该控件仅能放在语音页;宿主按钮在可信点击处理器内直接启动屏幕采集,避免异步 Wasm 回调丢失浏览器瞬时用户激活。自定义 UI 可以完全用普通声明式节点搭建,不需要采用这些控件。只显示收藏时可用 `favorites.items` 和 `favorites.switch`;若要将收藏与最近连接放在同一自定义栏,可用 `servers.quickList` 数据与 `quickServers.switch` 动作。服务器目标始终使用本机生成的不透明令牌,不把地址、密码或身份材料交给组件。频道行也可把 `voice.joinChannel` 绑定到双击事件,切房继续走 TeamSpeak 原有权限和密码流程。v3 还提供经独立权限保护的麦克风/扬声器、输出音量、离开状态、悄悄话、断开连接和屏幕共享动作;它们只调用 WebSpeak 已有操作,屏幕采集仍由浏览器或操作系统询问用户。 +当前可选宿主控件 ID:`home.connection-form`、`app.skin-switcher`、`app.language-switcher`、`voice.channel-panel`、`voice.member-cards`、`voice.chat-panel`、`voice.audio-controls`、`voice.screen-share-player`、`voice.screen-share-start`、`voice.whisper-controls`、`voice.performance-panel`、`voice.connection-controls`、`voice.disconnect-control`。未知控件和同页重复控件会被拒绝;每个控件的状态和业务动作仍由 WebSpeak 内部处理。schema v3 会检查受保护控件所需权限:音频控件需 `audio.status.read`、`audio.microphone.control` 和 `audio.output.control`;聊天需 `chat.channel.read` 与 `chat.channel.send`;成员卡片需 `session.members.read`、`session.memberAvatars.read` 及屏幕共享读取/控制权限;头像只在可信宿主控件内显示,不暴露给皮肤代码;屏幕共享播放器需 `voice.screenShare.read` 与 `voice.screenShare.control`;悄悄话控件需对应状态读取和控制权限;断开/连接控件需 `voice.disconnect`。既有 v2 包维持旧校验行为,`voice.screen-share-start` 仍像此前一样要求 `voice.screenShare.control`。该控件仅能放在语音页;宿主按钮在可信点击处理器内直接启动屏幕采集,避免异步 Wasm 回调丢失浏览器瞬时用户激活。自定义 UI 可以完全用普通声明式节点搭建,不需要采用这些控件。只显示收藏时可用 `favorites.items` 和 `favorites.switch`;若要将收藏与最近连接放在同一自定义栏,可用 `servers.quickList` 数据与 `quickServers.switch` 动作。服务器目标始终使用本机生成的不透明令牌,不把地址、密码或身份材料交给组件。频道行也可把 `voice.joinChannel` 绑定到双击事件,切房继续走 TeamSpeak 原有权限和密码流程。v3 还提供经独立权限保护的麦克风/扬声器、输出音量、离开状态、悄悄话、断开连接和屏幕共享动作;它们只调用 WebSpeak 已有操作,屏幕采集仍由浏览器或操作系统询问用户。 示例包见 [KAAK voice 示例](./examples/KAAK-VOICE.md),其 components.json 使用完整首页与语音工作区 surface,展示收藏服务器、频道树、在线成员、聊天和可信语音控制的组合;[Open Voice Surface](./examples/OPEN-VOICE-SURFACE.md) 保留为通用格式验证脚手架。KAAK 的语音视觉参考来自用户授权进入的前两个语音房间;只记录布局,不保留服务器/房间标识、成员名或聊天内容。当前数据权限和宿主动作以[开放皮肤规格](./OPEN_SKIN_SYSTEM_SPEC.zh-CN.md)中的清单为准。组件按本地用户授权后才渲染;权限对每个皮肤版本、页面和组件分别保存,可在宿主权限入口撤销。页面替换时,宿主会额外显示“返回标准界面”和“恢复内置皮肤”入口;拒绝授权或离开 surface 后,普通页面可立即恢复。 diff --git a/docs/examples/KAAK-VOICE.md b/docs/examples/KAAK-VOICE.md index 9a75f73..bb944a2 100644 --- a/docs/examples/KAAK-VOICE.md +++ b/docs/examples/KAAK-VOICE.md @@ -1,18 +1,18 @@ # KAAK voice skin -KAAK is a schema v3 open-skin package with full connection and voice-workspace surfaces. Its voice page follows KOOK's voice-room composition: a narrow server rail with the current identity at its foot, a server/channel tree, a central room stage with connected participants, a right-side channel chat, and a lower-left voice dock. Participants appear as portrait tiles with a lower name/status strip, hover depth, and a speaking ring plus waveform animation driven by the live speaking state. The host's screen-share player appears in the room stage when someone is sharing. The dock retains WebSpeak's trusted voice-quality, audio, screen-share, and disconnect controls. The roster shows connected TeamSpeak clients only; it does not invent an offline list. Channel selection is single-click; joining is double-click. The narrow layout keeps the host's mobile controls available while retaining readable member tiles. +KAAK is a schema v3 open-skin package with full connection and voice-workspace surfaces. Its voice page uses a narrow server rail, a server/channel tree, a central participant stage, right-side chat attached to the current voice channel, and a lower-left voice dock. The KOOK voice room is the point-to-point visual reference: composition, member presentation, styling, and motion should be compared directly, rather than treating matching component types or approximate placement as sufficient. The left tree contains the TeamSpeak voice channels only; KOOK's separate text-channel group is outside this pass because TeamSpeak has no equivalent channel type. The current voice channel's text chat remains on the right and can collapse into a narrow rail, then expand again without leaving the voice room. The central stage uses WebSpeak's reusable member-card widget so available TeamSpeak profile avatars appear inside KAAK's large portrait tiles; KAAK's CSS styles the cards and adds hover depth, a speaking ring, and a waveform pulse driven by live voice state. The host's screen-share player appears in the room stage when someone is sharing. The dock retains WebSpeak's trusted voice-quality, audio, screen-share, and disconnect controls. The roster shows connected TeamSpeak clients only; it does not invent an offline list. Channel selection is single-click; joining is double-click. The narrow layout keeps the host's mobile controls available while retaining readable member tiles. The design target is the voice-client portion of KOOK, as requested by the project owner. It does not include discovery, companion/party, event, store, advertising, administrator, or other service-operator pages. It does not add a KOOK account flow, direct messages, server administration, or channels absent from the connected TeamSpeak server. ## Reference access note -The owner authorized inspection of the first two voice rooms in the KOOK server. Both rooms were entered and viewed; the microphone remained off. The reference confirmed a narrow server rail, grouped channel list with inline voice participants, a central text chat workspace, a right-side online/offline member column, and a compact voice-control dock near the lower left. This is a layout and styling reference, not a claim of pixel-for-pixel reproduction. Server/room identifiers, member names, and chat contents were not recorded. +The owner authorized inspection of the first two voice rooms in the KOOK server. Both rooms were entered and viewed; the microphone remained off. The reference confirmed a narrow server rail, grouped channel list, a prominent participant presentation area, right-side channel chat, and a compact voice-control dock near the lower left. Server/room identifiers, member names, and chat contents were not recorded. ## Components and permissions -The connection page and voice workspace are full-page declarative surfaces in [components.json](./kaak-voice/components.json). The voice surface requests only the capabilities it uses: visible server shortcuts, channel and member data, channel joining, channel chat, voice status, microphone/output controls, whisper controls, disconnect, and screen sharing. The host renders trusted connection, language, skin, audio, and screen-share controls. It rechecks permissions and connection state when each action runs; approval is local to this skin version and can be revoked from the host access control. +The connection page and voice workspace are full-page declarative surfaces in [components.json](./kaak-voice/components.json). The voice surface requests only the capabilities it uses: visible server shortcuts, channel and member data, cached profile-avatar display inside the trusted member-card widget, channel joining, channel chat, voice status, microphone/output controls, whisper controls, disconnect, and screen sharing. The host renders trusted connection, language, skin, audio, and screen-share controls. It rechecks permissions and connection state when each action runs; approval is local to this skin version and can be revoked from the host access control. -Member avatar circles use the first character derived from the visible nickname; KAAK does not read profile image files. The skin does not receive server addresses, passwords, identity keys, raw audio, private messages, or arbitrary network/storage APIs. Its markup is data-only; it contains no executable JavaScript or Wasm. The `/demo` page uses synthetic data and does not connect to TeamSpeak. +Member cards are rendered by WebSpeak's trusted `voice.member-cards` widget. It displays an already available TeamSpeak profile avatar, or the host-generated nickname initial when no avatar is available; image bytes stay in the host and are not exposed in the skin's data context or Wasm runtime. The skin does not receive server addresses, passwords, identity keys, raw audio, private messages, or arbitrary network/storage APIs. Its markup is data-only; it contains no executable JavaScript or Wasm. The `/demo` page uses synthetic data and does not connect to TeamSpeak. ## Files diff --git a/docs/examples/kaak-voice.wskin b/docs/examples/kaak-voice.wskin index 993fb4e..725d60a 100644 Binary files a/docs/examples/kaak-voice.wskin and b/docs/examples/kaak-voice.wskin differ diff --git a/docs/examples/kaak-voice/components.json b/docs/examples/kaak-voice/components.json index 34c804c..fd6e07f 100644 --- a/docs/examples/kaak-voice/components.json +++ b/docs/examples/kaak-voice/components.json @@ -107,6 +107,7 @@ "session.status.read", "session.channels.read", "session.members.read", + "session.memberAvatars.read", "session.channel.join", "servers.quickList.read", "servers.quickList.switch", @@ -162,11 +163,18 @@ "args": { "active": false } + }, + "toggle-chat-panel": { + "type": "ui.toggleState", + "args": { + "key": "chatopen" + } } }, "state": { "selectedchannel": "", - "message": "" + "message": "", + "chatopen": true }, "root": { "tag": "main", @@ -516,7 +524,11 @@ { "text": "◉" } - ] + ], + "when": { + "path": "state.chatopen", + "equals": true + } }, { "tag": "h1", @@ -525,13 +537,17 @@ { "text": "{{session.status.channelName}}" } - ] + ], + "when": { + "path": "state.chatopen", + "equals": true + } }, { "tag": "span", "part": "connection-state", "when": { - "path": "session.status.connected", + "path": "state.chatopen", "equals": true }, "children": [ @@ -539,6 +555,46 @@ "text": "已连接" } ] + }, + { + "tag": "button", + "part": "chat-panel-toggle", + "attributes": { + "type": "button", + "aria-expanded": "{{state.chatopen}}", + "aria-label": "收起或展开当前语音频道文字聊天 / Toggle current voice channel chat" + }, + "events": { + "click": "toggle-chat-panel" + }, + "children": [ + { + "tag": "span", + "part": "chat-panel-chevron", + "when": { + "path": "state.chatopen", + "equals": true + }, + "children": [ + { + "text": "›" + } + ] + }, + { + "tag": "span", + "part": "chat-panel-chevron", + "when": { + "path": "state.chatopen", + "equals": false + }, + "children": [ + { + "text": "‹" + } + ] + } + ] } ] }, @@ -647,7 +703,11 @@ } ] } - ] + ], + "when": { + "path": "state.chatopen", + "equals": true + } } ] }, @@ -674,127 +734,8 @@ ] }, { - "tag": "ul", - "part": "member-list", - "children": [ - { - "tag": "li", - "part": "member-row", - "repeat": { - "path": "session.members", - "as": "member" - }, - "children": [ - { - "tag": "div", - "part": "member-avatar-stage", - "children": [ - { - "tag": "span", - "part": "member-avatar", - "children": [ - { - "text": "{{member.avatarInitial}}" - } - ] - }, - { - "tag": "span", - "part": "member-speaking-ring", - "when": { - "path": "member.speaking", - "equals": true - }, - "attributes": { - "aria-hidden": "true" - } - } - ] - }, - { - "tag": "div", - "part": "member-card-footer", - "children": [ - { - "tag": "span", - "part": "member-name", - "children": [ - { - "text": "{{member.name}}" - } - ] - }, - { - "tag": "span", - "part": "speaking-indicator", - "when": { - "path": "member.speaking", - "equals": true - }, - "attributes": { - "aria-label": "正在讲话" - }, - "children": [ - { - "tag": "span", - "part": "member-speaking-wave", - "attributes": { - "aria-hidden": "true" - }, - "children": [ - { "tag": "i", "part": "member-speaking-bar" }, - { "tag": "i", "part": "member-speaking-bar" }, - { "tag": "i", "part": "member-speaking-bar" } - ] - }, - { - "tag": "span", - "part": "member-speaking-label", - "children": [ - { - "text": "正在讲话" - } - ] - } - ] - }, - { - "tag": "span", - "part": "member-muted-state", - "when": { - "path": "member.status", - "equals": "muted" - }, - "attributes": { - "aria-label": "麦克风已静音" - }, - "children": [ - { - "text": "已静音" - } - ] - }, - { - "tag": "span", - "part": "member-away-state", - "when": { - "path": "member.status", - "equals": "away" - }, - "attributes": { - "aria-label": "离开" - }, - "children": [ - { - "text": "离开中" - } - ] - } - ] - } - ] - } - ] + "widget": "voice.member-cards", + "part": "member-cards" }, { "widget": "voice.screen-share-player", @@ -955,7 +896,10 @@ } ] } - ] + ], + "attributes": { + "data-chat-open": "{{state.chatopen}}" + } } } ] diff --git a/docs/examples/kaak-voice/manifest.json b/docs/examples/kaak-voice/manifest.json index d58a4d5..e981851 100644 --- a/docs/examples/kaak-voice/manifest.json +++ b/docs/examples/kaak-voice/manifest.json @@ -3,10 +3,10 @@ "packageType": "open-skin", "id": "community.kaak-voice", "name": "KAAK", - "version": "3.0.9", + "version": "3.1.5", "author": "WebSpeak Project", "license": "AGPL-3.0-only", - "description": "A complete dark voice-client workspace inspired by modern voice apps, built with WebSpeak host controls and public TeamSpeak data.", + "description": "A KOOK-inspired voice workspace with collapsible current voice-channel chat, TeamSpeak profile cards, and animated speaker states.", "entry": "skin.css", "components": "components.json", "content": "content.json", diff --git a/docs/examples/kaak-voice/skin.css b/docs/examples/kaak-voice/skin.css index 59f86aa..c179d51 100644 --- a/docs/examples/kaak-voice/skin.css +++ b/docs/examples/kaak-voice/skin.css @@ -128,6 +128,11 @@ color: var(--skin-kaak-text); background: var(--skin-kaak-bg); font-family: Inter, "Segoe UI", system-ui, sans-serif; + transition: grid-template-columns .2s ease; +} + +[data-ws-plugin-part="kaak-workspace"]:has([data-chat-open="false"]) { + grid-template-columns: 68px 276px minmax(280px, 1fr) 52px; } [data-ws-plugin-part="kaak-workspace"] .language-switcher .language-trigger, @@ -349,6 +354,12 @@ [data-ws-plugin-part="kaak-workspace.section-label"] { margin: 0 8px 7px; } +[data-ws-plugin-part="kaak-workspace.voice-channel-list"] { + display: flex; + flex-direction: column; + min-width: 0; +} + [data-ws-plugin-part="kaak-workspace.channel-row"] { position: relative; display: flex; @@ -615,36 +626,76 @@ border-bottom: 1px solid var(--skin-kaak-border); } +[data-ws-plugin-part="kaak-workspace.chat-panel-toggle"] { + display: grid; + flex: 0 0 36px; + place-items: center; + width: 36px; + height: 36px; + margin-left: auto; + border: 0; + border-radius: 7px; + color: var(--skin-kaak-muted); + background: transparent; + font-size: 22px; + line-height: 1; + cursor: pointer; + transition: color .16s ease, background-color .16s ease; +} + +[data-ws-plugin-part="kaak-workspace.chat-panel-toggle"]:hover { + color: var(--skin-kaak-text); + background: var(--skin-kaak-raised); +} + +[data-ws-plugin-part="kaak-workspace.chat-panel-chevron"] { display: block; } + +[data-ws-plugin-part="kaak-workspace"]:has([data-chat-open="false"]) [data-ws-plugin-part="kaak-workspace.conversation"] { + grid-template-rows: 48px; + gap: 0; + padding: 0 4px; +} + +[data-ws-plugin-part="kaak-workspace"]:has([data-chat-open="false"]) [data-ws-plugin-part="kaak-workspace.conversation-heading"] { + justify-content: center; + border-bottom: 0; +} + +[data-ws-plugin-part="kaak-workspace"]:has([data-chat-open="false"]) [data-ws-plugin-part="kaak-workspace.chat-panel-toggle"] { + flex-basis: 44px; + width: 44px; + height: 44px; + margin: 0; +} + [data-ws-plugin-part="kaak-workspace.voice-stage-heading"] .section-label { margin: 0; } [data-ws-plugin-part="kaak-workspace.member-total"] { color: var(--skin-kaak-dim); font-size: 11px; } -[data-ws-plugin-part="kaak-workspace.member-list"] { +[data-ws-plugin-part="kaak-workspace.member-cards"] { + flex: 1 1 auto; + min-width: 0; + min-height: 0; + overflow: hidden; +} + +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-grid { display: grid; - grid-template-columns: repeat(auto-fit, minmax(min(100%, 218px), 218px)); + grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); align-content: start; justify-content: center; + justify-items: center; gap: 12px; margin: 14px 0 16px; padding: 0; - list-style: none; } -[data-ws-plugin-part="kaak-workspace.member-group-label"] { - grid-column: 1 / -1; - margin: 2px 5px 3px; - color: var(--skin-kaak-dim); - font-size: 9px; - font-weight: 800; - letter-spacing: .08em; - list-style: none; -} - -[data-ws-plugin-part="kaak-workspace.member-row"] { +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card { position: relative; isolation: isolate; display: grid; - grid-template-rows: minmax(0, 1fr) auto; + grid-template-rows: minmax(0, 1fr) auto auto; width: 100%; + max-width: 218px; min-width: 0; min-height: 274px; overflow: hidden; @@ -654,10 +705,11 @@ color: var(--skin-kaak-text); background: #202125; box-shadow: 0 10px 28px #0003; + text-align: left; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; } -[data-ws-plugin-part="kaak-workspace.member-row"]::before { +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card::before { position: absolute; z-index: -1; inset: 0; @@ -668,180 +720,82 @@ transition: transform .32s ease, filter .32s ease; } -[data-ws-plugin-part="kaak-workspace.member-row"]:hover { +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card:hover { + z-index: 3; transform: translateY(-3px); border-color: #ffffff35; box-shadow: 0 16px 34px #0006; } -[data-ws-plugin-part="kaak-workspace.member-row"]:hover::before { transform: scale(1.045); filter: brightness(1.08); } +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card:hover::before { transform: scale(1.045); filter: brightness(1.08); } +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card.speaking { border-color: #58c87788; box-shadow: 0 0 0 1px #58c87722, 0 10px 28px #0005; } -[data-ws-plugin-part="kaak-workspace.member-avatar-stage"] { +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-avatar-wrap { position: relative; + z-index: 0; display: grid; place-items: center; + grid-row: 1; + width: 100%; min-height: 0; + margin: 0; padding: 14px 12px 4px; } -[data-ws-plugin-part="kaak-workspace.member-avatar-stage"]::before { +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-avatar-wrap::before, +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-avatar-wrap::after { position: absolute; + inset: 0; width: 126px; height: 126px; + margin: auto; border: 1px solid #ffffff0c; border-radius: 50%; content: ""; + pointer-events: none; transition: transform .25s ease, border-color .25s ease; } -[data-ws-plugin-part="kaak-workspace.member-row"]:hover [data-ws-plugin-part="kaak-workspace.member-avatar-stage"]::before { - transform: scale(1.06); - border-color: #ffffff1d; -} +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card:hover .voice-avatar-wrap::before { transform: scale(1.06); border-color: #ffffff1d; } +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-avatar { position: relative; z-index: 1; width: 100px; height: 100px; border: 3px solid #ffffff20; box-shadow: 0 0 0 6px #11121655, inset 0 2px 8px #ffffff1a, 0 14px 30px #0006; font-size: 34px; text-shadow: 0 2px 9px #0008; transition: transform .25s ease, box-shadow .25s ease; } +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card:hover .voice-avatar { transform: scale(1.035); box-shadow: 0 0 0 7px #11121666, inset 0 2px 8px #ffffff1a, 0 18px 34px #0008; } +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card[data-ws-speaking="true"] .voice-avatar-wrap::before { border: 2px solid #58c877b8; animation: kaak-member-speaking-ring 1.8s ease-out infinite; } +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card[data-ws-speaking="true"] .voice-avatar-wrap::after { border-color: #58c877; animation: kaak-member-speaking-ring 1.8s ease-out .9s infinite; } -[data-ws-plugin-part="kaak-workspace"] .screen-share-player { - width: 100%; - margin: auto 0 0; - border-color: var(--skin-kaak-border); - border-radius: 10px; - background: var(--skin-kaak-panel); - box-shadow: none; -} - -[data-ws-plugin-part="kaak-workspace"] .screen-share-player-stage { min-height: 150px; border-radius: 9px; } - -[data-ws-plugin-part="kaak-workspace.member-avatar"] { +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card > strong, +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card > span { position: relative; z-index: 1; - display: grid; - place-items: center; - width: 100px; - height: 100px; + min-width: 0; overflow: hidden; - border-radius: 50%; - border: 3px solid #ffffff20; - color: #f4f3ff; - background: - radial-gradient(circle at 34% 28%, #8882aa 0, #5a586e 28%, #3b3b47 58%, #292a31 100%); - box-shadow: 0 0 0 6px #11121655, inset 0 2px 8px #ffffff1a, 0 14px 30px #0006; - font-size: 34px; - font-weight: 750; - text-shadow: 0 2px 9px #0008; - transition: transform .25s ease, box-shadow .25s ease; -} - -[data-ws-plugin-part="kaak-workspace.member-row"]:hover [data-ws-plugin-part="kaak-workspace.member-avatar"] { - transform: scale(1.035); - box-shadow: 0 0 0 7px #11121666, inset 0 2px 8px #ffffff1a, 0 18px 34px #0008; -} - -[data-ws-plugin-part="kaak-workspace.member-speaking-ring"] { - position: absolute; - z-index: 0; - width: 112px; - height: 112px; - border: 2px solid #a79affb8; - border-radius: 50%; - animation: kaak-member-speaking-ring 1.8s ease-out infinite; -} - -[data-ws-plugin-part="kaak-workspace.member-speaking-ring"]::after { - position: absolute; - inset: -2px; - border: 1px solid #a79aff; - border-radius: 50%; - content: ""; - animation: kaak-member-speaking-ring 1.8s ease-out .9s infinite; -} - -[data-ws-plugin-part="kaak-workspace.member-card-footer"] { - position: relative; - display: flex; - flex-wrap: wrap; - align-items: center; - gap: 5px 8px; - min-height: 64px; - padding: 11px 13px 12px; + padding-inline: 13px; + color: var(--skin-kaak-text); + text-overflow: ellipsis; + white-space: nowrap; background: linear-gradient(180deg, #191a1db8, #17181bf5 42%); } -[data-ws-plugin-part="kaak-workspace.member-name"] { - min-width: 0; - flex: 1 1 100%; - overflow: hidden; - color: var(--skin-kaak-text); - font-size: 14px; - font-weight: 750; - text-overflow: ellipsis; - white-space: nowrap; -} +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card > strong { grid-row: 2; padding-top: 11px; font-size: 14px; font-weight: 750; } +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card > span { grid-row: 3; margin: 0; padding-top: 3px; padding-bottom: 12px; color: #b2b3b9; font-size: 10px; } +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card[data-ws-speaking="true"] > span { color: #b2a8ff; } +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card[data-ws-speaking="true"] > span::after { display: inline-block; margin-left: 7px; color: #b2a8ff; content: "▂▆▃"; font-size: 10px; letter-spacing: 1px; line-height: 1; vertical-align: 1px; transform-origin: center; animation: kaak-member-speaking-wave .72s ease-in-out infinite alternate; } +[data-ws-plugin-part="kaak-workspace.member-cards"] .screen-share-card-actions { grid-column: 1; grid-row: 4; padding: 0 12px 12px; background: #17181bf5; } +[data-ws-plugin-part="kaak-workspace.member-cards"] .screen-share-card-button { min-height: 36px; border-color: #ffffff1a; border-radius: 7px; color: var(--skin-kaak-text); background: #292a2f; } +[data-ws-plugin-part="kaak-workspace.member-cards"] .screen-share-card-button:hover { border-color: #58c87788; background: #303137; } +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-member-action { position: absolute; z-index: 2; top: 9px; right: 9px; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #ffffff22; border-radius: 50%; color: var(--skin-kaak-text); background: #17181bcc; } -[data-ws-plugin-part="kaak-workspace.speaking-indicator"] { - display: inline-flex; - align-items: center; - gap: 6px; - color: #b2a8ff; - font-size: 10px; - font-weight: 700; -} - -[data-ws-plugin-part="kaak-workspace.member-speaking-wave"] { - display: inline-flex; - align-items: center; - gap: 2px; - height: 13px; -} - -[data-ws-plugin-part="kaak-workspace.member-speaking-bar"] { - width: 2px; - height: 7px; - border-radius: 2px; - background: #b2a8ff; - transform-origin: center; - animation: kaak-member-speaking-bars .72s ease-in-out infinite alternate; -} - -[data-ws-plugin-part="kaak-workspace.member-speaking-bar"]:nth-child(2) { animation-delay: .18s; } -[data-ws-plugin-part="kaak-workspace.member-speaking-bar"]:nth-child(3) { animation-delay: .34s; } - -[data-ws-plugin-part="kaak-workspace.member-muted-state"], -[data-ws-plugin-part="kaak-workspace.member-away-state"] { - display: inline-flex; - align-items: center; - gap: 5px; - color: #b2b3b9; - font-size: 10px; -} - -[data-ws-plugin-part="kaak-workspace.member-muted-state"]::before { - display: grid; - place-items: center; - width: 15px; - height: 15px; - border-radius: 50%; - color: #f08b91; - background: #ed6e771c; - content: "×"; - font-size: 13px; - font-weight: 800; -} - -[data-ws-plugin-part="kaak-workspace.member-away-state"]::before { - width: 6px; - height: 6px; - border-radius: 50%; - background: #d9ad68; - content: ""; -} +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-empty { display: grid; min-height: 160px; place-content: center; justify-items: center; gap: 8px; color: var(--skin-kaak-muted); text-align: center; } +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-empty strong { color: var(--skin-kaak-text); font-size: 14px; } +[data-ws-plugin-part="kaak-workspace.member-cards"] .voice-empty > span:last-child { font-size: 11px; } @keyframes kaak-member-speaking-ring { 0% { transform: scale(.84); opacity: .72; } 100% { transform: scale(1.42); opacity: 0; } } -@keyframes kaak-member-speaking-bars { - 0% { transform: scaleY(.38); opacity: .65; } - 100% { transform: scaleY(1.15); opacity: 1; } +@keyframes kaak-member-speaking-wave { + 0% { transform: scaleY(.65); opacity: .7; } + 100% { transform: scaleY(1.12); opacity: 1; } } [data-ws-plugin-part="kaak-workspace.voice-dock"] { @@ -1018,11 +972,34 @@ outline-offset: 2px; } -@media (max-width: 1060px) { +@media (max-width: 1200px) { [data-ws-plugin-part="kaak-workspace"] { - grid-template-columns: 60px 236px minmax(240px, 1fr) minmax(300px, 36vw); + grid-template-columns: 56px 204px minmax(340px, 1fr) minmax(280px, 32vw); } - [data-ws-plugin-part="kaak-workspace.identity-entry"] { width: 60px; } + [data-ws-plugin-part="kaak-workspace"]:has([data-chat-open="false"]) { + grid-template-columns: 56px 204px minmax(340px, 1fr) 48px; + } + [data-ws-plugin-part="kaak-workspace.identity-entry"] { width: 56px; } +} + +@media (max-width: 960px) { + [data-ws-plugin-part="kaak-workspace"] { + grid-template-columns: 52px 184px minmax(260px, 1fr) minmax(260px, 29vw); + } + [data-ws-plugin-part="kaak-workspace"]:has([data-chat-open="false"]) { + grid-template-columns: 52px 184px minmax(260px, 1fr) 48px; + } + [data-ws-plugin-part="kaak-workspace.identity-entry"] { width: 52px; } + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-grid { + grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); + } + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card { + max-width: 190px; + min-height: 236px; + } + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-avatar-wrap::before, + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-avatar-wrap::after { width: 112px; height: 112px; } + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-avatar { width: 88px; height: 88px; font-size: 30px; } } @media (max-width: 820px) { @@ -1070,10 +1047,16 @@ [data-ws-plugin-part="kaak-workspace.channel-list"] > [data-ws-plugin-part="kaak-workspace.section-label"] { display: none; } [data-ws-plugin-part="kaak-workspace.channel-list"] { flex-direction: row; + align-items: center; gap: 5px; overflow: auto hidden; padding: 0; } + [data-ws-plugin-part="kaak-workspace"]:has([data-chat-open="false"]) { + grid-template-columns: 56px minmax(0, 1fr); + grid-template-rows: 50px 126px minmax(176px, 24dvh) 44px 74px; + } + [data-ws-plugin-part="kaak-workspace.voice-channel-list"] { flex: 0 0 auto; flex-direction: row; align-items: flex-start; gap: 5px; } [data-ws-plugin-part="kaak-workspace.channel-item"] { flex: 0 0 auto; } [data-ws-plugin-part="kaak-workspace.channel-row"] { width: max-content; min-width: 116px; min-height: 42px; margin: 0; } [data-ws-plugin-part="kaak-workspace.channel-row"][data-depth] { padding-inline-start: 9px; } @@ -1097,37 +1080,31 @@ padding: 0 8px 6px; } + [data-ws-plugin-part="kaak-workspace"]:has([data-chat-open="false"]) [data-ws-plugin-part="kaak-workspace.conversation"] { + grid-template-rows: 40px; + padding: 0 4px; + } + + [data-ws-plugin-part="kaak-workspace"]:has([data-chat-open="false"]) [data-ws-plugin-part="kaak-workspace.chat-panel-toggle"] { + flex-basis: 40px; + width: 40px; + height: 40px; + } + [data-ws-plugin-part="kaak-workspace.voice-stage-heading"] { min-height: 22px; border: 0; } [data-ws-plugin-part="kaak-workspace.voice-stage-heading"] .section-label { max-width: 160px; font-size: 8px; } - [data-ws-plugin-part="kaak-workspace.member-list"] { - display: flex; - flex: 1 1 auto; - min-width: 0; - min-height: 0; - align-items: stretch; - gap: 8px; - overflow: auto hidden; - margin: 3px 0 0; - } - [data-ws-plugin-part="kaak-workspace.member-group-label"] { display: none; } - [data-ws-plugin-part="kaak-workspace.member-row"] { - flex: 0 0 174px; - min-height: 0; - height: 100%; - border-radius: 9px; - } - [data-ws-plugin-part="kaak-workspace.member-avatar-stage"] { padding: 8px 8px 2px; } - [data-ws-plugin-part="kaak-workspace.member-avatar-stage"]::before { width: 96px; height: 96px; } - [data-ws-plugin-part="kaak-workspace.member-avatar"] { width: 72px; height: 72px; font-size: 26px; } - [data-ws-plugin-part="kaak-workspace.member-speaking-ring"] { width: 82px; height: 82px; } - [data-ws-plugin-part="kaak-workspace.member-card-footer"] { min-height: 50px; gap: 3px 6px; padding: 7px 9px 8px; } - [data-ws-plugin-part="kaak-workspace.member-name"] { font-size: 12px; } - [data-ws-plugin-part="kaak-workspace.speaking-indicator"], - [data-ws-plugin-part="kaak-workspace.member-muted-state"], - [data-ws-plugin-part="kaak-workspace.member-away-state"] { font-size: 9px; } - [data-ws-plugin-part="kaak-workspace.member-muted-state"]::before { width: 13px; height: 13px; } + [data-ws-plugin-part="kaak-workspace.member-cards"] { display: flex; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; } + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-grid { display: flex; flex: 1 1 auto; min-width: 0; min-height: 0; align-items: stretch; gap: 8px; overflow: auto hidden; margin: 3px 0 0; padding: 2px 2px 4px; } + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card { flex: 0 0 174px; min-height: 0; height: 100%; border-radius: 9px; } + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-avatar-wrap { padding: 8px 8px 2px; } + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-avatar-wrap::before, + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-avatar-wrap::after { width: 96px; height: 96px; } + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-avatar { width: 72px; height: 72px; font-size: 26px; } + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card > strong { padding: 7px 9px 0; font-size: 12px; } + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-card > span { padding: 3px 9px 8px; font-size: 9px; } + [data-ws-plugin-part="kaak-workspace.member-cards"] .voice-member-action { width: 32px; height: 32px; } - [data-ws-plugin-part="kaak-workspace.voice-dock"] { +[data-ws-plugin-part="kaak-workspace.voice-dock"] { grid-column: 2; grid-row: 5; align-self: stretch; @@ -1173,6 +1150,9 @@ grid-template-rows: 46px 104px minmax(138px, 25dvh) minmax(136px, 1fr) 62px; min-height: 0; } + [data-ws-plugin-part="kaak-workspace"]:has([data-chat-open="false"]) { + grid-template-rows: 46px 104px minmax(138px, 25dvh) 44px 62px; + } } @media (prefers-reduced-motion: reduce) { diff --git a/src/shared/skin-plugin.test.ts b/src/shared/skin-plugin.test.ts index 95773b0..96642fe 100644 --- a/src/shared/skin-plugin.test.ts +++ b/src/shared/skin-plugin.test.ts @@ -163,6 +163,18 @@ test("schema v3 host audio controls require read and control permissions while v assert.equal(parseSkinPluginDocument(legacyDocument).components[0].root.children?.[0].widget, "voice.audio-controls"); }); +test("schema v3 member cards require a separate permission to display cached profile pictures", () => { + const document = validDocument(); + document.schemaVersion = 3; + document.components[0].actions = {}; + document.components[0].permissions = ["session.members.read", "voice.screenShare.read", "voice.screenShare.control"]; + document.components[0].root = { tag: "main", children: [{ widget: "voice.member-cards" }] }; + errorCode(() => parseSkinPluginDocument(document), "SKIN_PLUGIN_PERMISSION_MISSING"); + + document.components[0].permissions.push("session.memberAvatars.read"); + assert.equal(parseSkinPluginDocument(document).components[0].root.children?.[0].widget, "voice.member-cards"); +}); + test("KAAK v3 example declares the connection home and complete voice workspace", async () => { const source = await readFile(new URL("../../docs/examples/kaak-voice/components.json", import.meta.url), "utf8"); const parsed = parseSkinPluginJson(source); @@ -179,6 +191,7 @@ test("KAAK v3 example declares the connection home and complete voice workspace" assert.equal(workspace.mode, "surface"); assert.ok(workspace.permissions.includes("session.channels.read")); assert.ok(workspace.permissions.includes("session.members.read")); + assert.ok(workspace.permissions.includes("session.memberAvatars.read")); assert.ok(workspace.permissions.includes("chat.channel.send")); assert.ok(workspace.permissions.includes("audio.microphone.control")); assert.equal(workspace.actions["join-channel"].type, "voice.joinChannel"); @@ -191,9 +204,10 @@ test("KAAK v3 example declares the connection home and complete voice workspace" }; visit(workspace.root); assert.ok(nodes.some((node) => node.widget === "voice.audio-controls")); + assert.ok(nodes.some((node) => node.widget === "voice.member-cards")); assert.ok(nodes.some((node) => node.widget === "voice.screen-share-start")); assert.ok(nodes.some((node) => node.repeat?.path === "session.channels" && node.children?.[0].events?.dblclick === "join-channel")); - assert.ok(nodes.some((node) => node.repeat?.path === "session.members")); + assert.ok(!nodes.some((node) => node.repeat?.path === "session.members"), "member imagery stays inside the trusted host widget"); assert.ok(nodes.some((node) => node.tag === "input" && node.bindValue === "message")); }); diff --git a/src/shared/skin-plugin.ts b/src/shared/skin-plugin.ts index d8924db..17ba5af 100644 --- a/src/shared/skin-plugin.ts +++ b/src/shared/skin-plugin.ts @@ -17,6 +17,7 @@ export const SKIN_PLUGIN_PERMISSIONS = Object.freeze({ "session.status.read": Object.freeze({ policyVersion: 1, description: "Read the current connection and channel summary." }), "session.channels.read": Object.freeze({ policyVersion: 1, description: "Read the public TeamSpeak channel tree; the demo page uses synthetic sample data." }), "session.members.read": Object.freeze({ policyVersion: 1, description: "Read visible member names, initials derived from those names, and speaking states; the demo page uses synthetic sample data." }), + "session.memberAvatars.read": Object.freeze({ policyVersion: 1, description: "Display cached TeamSpeak profile pictures for visible members inside the trusted host member-card widget. Images are not exposed to skin markup or plugin runtimes." }), "chat.channel.read": Object.freeze({ policyVersion: 1, description: "Read the current public text channel; the demo page uses synthetic sample data." }), "chat.channel.send": Object.freeze({ policyVersion: 1, description: "Send to the current public text channel; the demo page only simulates this action." }), "favorites.read": Object.freeze({ policyVersion: 1, description: "Read favorite labels and opaque local identifiers, without server addresses or credentials." }), @@ -61,7 +62,7 @@ export const SKIN_PLUGIN_HOST_WIDGET_PERMISSIONS: Partial { + const context = { + session: { + members: [{ id: "member-1", name: "Visible member", channelId: "channel-1", status: "online", speaking: false, self: false, avatar: "data:image/png;base64,cHJpdmF0ZQ==" }], + }, + }; + const displayOnly = projectSkinRuntimePluginContext(["session.memberAvatars.read"], context); + assert.deepEqual(JSON.parse(JSON.stringify(displayOnly)), {}); + + const readableMembers = projectSkinRuntimePluginContext(["session.members.read", "session.memberAvatars.read"], context); + assert.deepEqual(JSON.parse(JSON.stringify(readableMembers)), { + session: { + members: [{ id: "member-1", name: "Visible member", channelId: "channel-1", status: "online", speaking: false, self: false }], + }, + }); + assert.equal(JSON.stringify(readableMembers).includes("data:image"), false); +}); + test("large runtime context is capped across separately bounded collections", () => { const projected = projectSkinRuntimePluginContext(["session.channels.read", "chat.channel.read"], { session: { diff --git a/web/public/skins/kaak-voice.wskin b/web/public/skins/kaak-voice.wskin index 993fb4e..725d60a 100644 Binary files a/web/public/skins/kaak-voice.wskin and b/web/public/skins/kaak-voice.wskin differ diff --git a/web/src/services/skin-catalog.ts b/web/src/services/skin-catalog.ts index 4adb686..ee7ad99 100644 --- a/web/src/services/skin-catalog.ts +++ b/web/src/services/skin-catalog.ts @@ -46,10 +46,10 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [ { id: BUILTIN_KAAK_SKIN_ID, name: "KAAK", - version: "3.0.9", + version: "3.1.5", author: "WebSpeak Project", license: "AGPL-3.0-only", - description: "A KOOK-inspired voice-room workspace with server switching, channels, participant stage, chat, and host-owned voice controls.", + description: "A KOOK-inspired voice-room workspace with collapsible current voice-channel chat, TeamSpeak profile cards, and host-owned voice controls.", minAppVersion: "0.2.7-preview", installedAt: 0, builtIn: true, diff --git a/web/src/services/skin-pack.test.ts b/web/src/services/skin-pack.test.ts index a6e1b5c..0ea0f93 100644 --- a/web/src/services/skin-pack.test.ts +++ b/web/src/services/skin-pack.test.ts @@ -464,7 +464,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.0.9"); + assert.equal(skin.version, "3.1.5"); 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"); @@ -478,6 +478,7 @@ test("the distributable KAAK package provides full home and voice surfaces", asy assert.ok(voice?.permissions.includes("servers.quickList.switch")); assert.ok(voice?.permissions.includes("session.channels.read")); assert.ok(voice?.permissions.includes("session.members.read")); + assert.ok(voice?.permissions.includes("session.memberAvatars.read")); assert.ok(voice?.permissions.includes("chat.channel.read")); assert.ok(voice?.permissions.includes("chat.channel.send")); assert.ok(voice?.permissions.includes("audio.microphone.control")); @@ -495,29 +496,37 @@ test("the distributable KAAK package provides full home and voice surfaces", asy const channelRow = findPart(voice?.root, "channel-row"); assert.equal(channelRow?.events?.click, "select-channel"); assert.equal(channelRow?.events?.dblclick, "join-channel"); + assert.equal(findPart(voice?.root, "text-channel-group-toggle"), undefined); + assert.equal(findPart(voice?.root, "text-channel-list"), undefined); + assert.equal(findPart(voice?.root, "voice-channel-group-toggle"), undefined); + assert.equal(findPart(voice?.root, "voice-channel-list")?.when, undefined); + const chatToggle = findPart(voice?.root, "chat-panel-toggle"); + assert.equal(chatToggle?.events?.click, "toggle-chat-panel"); + assert.equal(chatToggle?.attributes?.["aria-expanded"], "{{state.chatopen}}"); + assert.deepEqual(findPart(voice?.root, "chat")?.when, { path: "state.chatopen", equals: true }); + assert.equal(voice?.root.attributes?.["data-chat-open"], "{{state.chatopen}}"); assert.equal(findPart(voice?.root, "server-monogram")?.children?.[0]?.text, "{{server.monogram}}"); assert.deepEqual(findPart(voice?.root, "channel-voice-members")?.when, { path: "channel.members", empty: false }); assert.equal(findPart(voice?.root, "channel-voice-member")?.repeat?.path, "channel.members"); assert.equal(findPart(voice?.root, "channel-member-avatar")?.children?.[0]?.text, "{{voicemember.avatarInitial}}"); assert.equal(findPart(voice?.root, "voice-stage")?.attributes?.["aria-label"], "语音房间 / Voice room"); - assert.equal(findPart(voice?.root, "member-group-label"), undefined); - assert.equal(findPart(voice?.root, "member-avatar")?.children?.[0]?.text, "{{member.avatarInitial}}"); - assert.equal(findPart(voice?.root, "member-speaking-ring")?.when?.path, "member.speaking"); - assert.equal(findPart(voice?.root, "member-speaking-wave")?.attributes?.["aria-hidden"], "true"); - assert.equal(findPart(voice?.root, "member-speaking-bar")?.tag, "i"); + assert.equal(findPart(voice?.root, "member-cards")?.widget, "voice.member-cards"); + assert.equal(findPart(voice?.root, "member-list"), undefined); assert.equal(findPart(voice?.root, "screen-player")?.widget, "voice.screen-share-player"); assert.equal(findPart(voice?.root, "performance-panel")?.widget, "voice.performance-panel"); assert.equal(findPart(voice?.root, "chat-input")?.bindValue, "message"); assert.equal(findPart(voice?.root, "screen-share-start")?.widget, "voice.screen-share-start"); assert.equal(findPart(voice?.root, "audio-controls")?.widget, "voice.audio-controls"); assert.ok(skin.css.includes('[data-ws-plugin-part="kaak-workspace.channel-row"]')); + assert.match(skin.css, /data-chat-open="false"[\s\S]*?grid-template-columns:[^;]*52px;/); + assert.match(skin.css, /kaak-workspace\.chat-panel-toggle/); assert.match(skin.css, /kaak-workspace\.voice-stage[\s\S]*?grid-column: 3;/); assert.match(skin.css, /kaak-workspace\.conversation[\s\S]*?grid-column: 4;/); - assert.match(skin.css, /kaak-workspace\.member-row[\s\S]*?min-height: 274px;/); + assert.match(skin.css, /kaak-workspace\.member-cards[\s\S]*?\.voice-card[\s\S]*?min-height: 274px;/); assert.match(skin.css, /@keyframes ws-community-kaak-voice-kaak-member-speaking-ring/); assert.match(skin.css, /animation: ws-community-kaak-voice-kaak-member-speaking-ring 1\.8s ease-out infinite/); - assert.match(skin.css, /@keyframes ws-community-kaak-voice-kaak-member-speaking-bars/); - assert.match(skin.css, /animation: ws-community-kaak-voice-kaak-member-speaking-bars \.72s ease-in-out infinite alternate/); + assert.match(skin.css, /@keyframes ws-community-kaak-voice-kaak-member-speaking-wave/); + assert.match(skin.css, /animation: ws-community-kaak-voice-kaak-member-speaking-wave \.72s ease-in-out infinite alternate/); assert.match(skin.css, /kaak-workspace\.identity-entry[\s\S]*?position: absolute;/); assert.ok(skin.css.includes("@media (max-width: 820px)")); });