Files
WebSpeak-client-for-TeamSpeak/docs/examples/kaak-voice/components.json
T

940 lines
32 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"schemaVersion": 3,
"components": [
{
"id": "kaak-home",
"name": "KAAK connection home",
"page": "home",
"mode": "surface",
"accessibleName": "KAAK 连接页 / Connection page",
"permissions": [
"ui.surface.replace"
],
"actions": {},
"root": {
"tag": "main",
"part": "home",
"children": [
{
"tag": "header",
"part": "home-header",
"children": [
{
"tag": "span",
"part": "brand-mark",
"children": [
{
"text": "K"
}
]
},
{
"tag": "span",
"part": "brand-name",
"children": [
{
"text": "KAAK"
}
]
},
{
"widget": "app.language-switcher",
"part": "language"
},
{
"widget": "app.skin-switcher",
"part": "skin"
}
]
},
{
"tag": "section",
"part": "connection-card",
"children": [
{
"tag": "p",
"part": "eyebrow",
"children": [
{
"text": "VOICE CLIENT / 语音客户端"
}
]
},
{
"tag": "h1",
"part": "title",
"children": [
{
"text": "连接你的语音社区"
}
]
},
{
"tag": "p",
"part": "description",
"children": [
{
"text": "选择 TeamSpeak 服务器,快速回到你的语音频道。"
}
]
},
{
"widget": "home.connection-form",
"part": "connection-form"
}
]
},
{
"tag": "footer",
"part": "home-footer",
"children": [
{
"text": "连接和身份信息由 WebSpeak 管理。"
}
]
}
]
}
},
{
"id": "kaak-workspace",
"name": "KAAK voice workspace",
"page": "voice",
"mode": "surface",
"accessibleName": "KAAK 语音工作区 / Voice workspace",
"permissions": [
"ui.surface.replace",
"session.status.read",
"session.channels.read",
"session.members.read",
"session.memberAvatars.read",
"session.channel.join",
"servers.quickList.read",
"servers.quickList.switch",
"chat.channel.read",
"chat.channel.send",
"audio.status.read",
"audio.microphone.control",
"audio.output.control",
"voice.whisper.status.read",
"voice.whisper.control",
"voice.disconnect",
"voice.screenShare.read",
"voice.screenShare.control"
],
"actions": {
"switch-server": {
"type": "quickServers.switch",
"args": {
"quickServerId": "{{server.id}}"
}
},
"select-channel": {
"type": "ui.setState",
"args": {
"key": "selectedchannel",
"value": "{{channel.id}}"
}
},
"join-channel": {
"type": "voice.joinChannel",
"args": {
"channelId": "{{channel.id}}"
}
},
"send-message": {
"type": "chat.sendMessage",
"args": {
"text": "{{state.message}}"
}
},
"disconnect": {
"type": "voice.disconnect",
"args": {}
},
"whisper-on": {
"type": "voice.setWhisperActive",
"args": {
"active": true
}
},
"whisper-off": {
"type": "voice.setWhisperActive",
"args": {
"active": false
}
},
"toggle-chat-panel": {
"type": "ui.toggleState",
"args": {
"key": "chatopen"
}
},
"toggle-voice-group": {
"type": "ui.toggleState",
"args": {
"key": "voicegroupopen"
}
}
},
"state": {
"selectedchannel": "",
"message": "",
"chatopen": true,
"voicegroupopen": true
},
"root": {
"tag": "main",
"part": "workspace",
"children": [
{
"tag": "header",
"part": "topbar",
"children": [
{
"tag": "span",
"part": "brand-mark",
"children": [
{
"text": "K"
}
]
},
{
"tag": "span",
"part": "brand-name",
"children": [
{
"text": "KAAK"
}
]
},
{
"tag": "span",
"part": "server-title",
"children": [
{
"text": "{{session.status.serverLabel}}"
}
]
},
{
"widget": "app.language-switcher",
"part": "language"
},
{
"widget": "app.skin-switcher",
"part": "skin"
}
]
},
{
"tag": "nav",
"part": "server-rail",
"attributes": {
"aria-label": "收藏与历史服务器 / Favorites and history"
},
"children": [
{
"tag": "div",
"part": "quick-server-item",
"repeat": {
"path": "servers.quickList",
"as": "server"
},
"children": [
{
"tag": "button",
"part": "quick-server",
"attributes": {
"type": "button",
"aria-current": "{{server.current}}",
"aria-label": "切换到 {{server.label}}"
},
"events": {
"click": "switch-server"
},
"children": [
{
"tag": "span",
"part": "server-monogram",
"attributes": {
"data-tone": "{{server.tone}}"
},
"children": [
{
"text": "{{server.monogram}}"
}
]
},
{
"tag": "span",
"part": "server-kind",
"when": {
"path": "server.favorite",
"equals": true
},
"children": [
{
"text": "收藏"
}
]
},
{
"tag": "span",
"part": "server-kind",
"when": {
"path": "server.kind",
"equals": "recent"
},
"children": [
{
"text": "最近"
}
]
}
]
}
]
}
]
},
{
"tag": "aside",
"part": "channel-panel",
"attributes": {
"aria-label": "服务器频道 / Server channels"
},
"children": [
{
"tag": "header",
"part": "server-summary",
"children": [
{
"tag": "strong",
"part": "server-name",
"children": [
{
"text": "{{session.status.serverLabel}}"
}
]
},
{
"tag": "small",
"part": "server-subtitle",
"children": [
{
"text": "VOICE CHANNELS / 语音频道"
}
]
}
]
},
{
"tag": "nav",
"part": "channel-list",
"attributes": {
"aria-label": "频道 / Channels"
},
"children": [
{
"tag": "button",
"part": "voice-channel-group-toggle",
"attributes": {
"type": "button",
"aria-expanded": "{{state.voicegroupopen}}",
"aria-label": "展开或收起语音分组 / Toggle voice group"
},
"events": {
"click": "toggle-voice-group"
},
"children": [
{
"tag": "span",
"part": "voice-group-chevron",
"attributes": {
"aria-hidden": "true"
},
"children": [
{
"text": "›"
}
]
},
{
"tag": "span",
"part": "voice-group-name",
"children": [
{
"text": "语音分组"
}
]
}
]
},
{
"tag": "div",
"part": "voice-channel-list",
"when": {
"path": "state.voicegroupopen",
"equals": true
},
"children": [
{
"tag": "div",
"part": "voice-channel-items",
"children": [
{
"tag": "div",
"part": "channel-item",
"repeat": {
"path": "session.channels",
"as": "channel"
},
"children": [
{
"tag": "button",
"part": "channel-row",
"attributes": {
"type": "button",
"aria-current": "{{channel.current}}",
"aria-label": "双击加入 {{channel.name}}",
"data-depth": "{{channel.depth}}"
},
"events": {
"click": "select-channel",
"dblclick": "join-channel"
},
"children": [
{
"tag": "span",
"part": "channel-glyph",
"children": [
{
"text": "◉"
}
]
},
{
"tag": "span",
"part": "channel-name",
"children": [
{
"text": "{{channel.name}}"
}
]
},
{
"tag": "small",
"part": "channel-count",
"children": [
{
"text": "{{channel.memberCount}}"
}
]
},
{
"tag": "span",
"part": "selected-channel-indicator",
"when": {
"path": "state.selectedchannel",
"equals": "{{channel.id}}"
},
"attributes": {
"aria-label": "当前频道"
}
}
]
},
{
"tag": "ul",
"part": "channel-voice-members",
"when": {
"path": "channel.members",
"empty": false
},
"attributes": {
"aria-label": "此频道中的语音成员 / Voice members in this channel"
},
"children": [
{
"tag": "li",
"part": "channel-voice-member",
"repeat": {
"path": "channel.members",
"as": "voicemember"
},
"children": [
{
"tag": "span",
"part": "channel-member-avatar",
"children": [
{
"text": "{{voicemember.avatarInitial}}"
}
]
},
{
"tag": "span",
"part": "channel-member-name",
"children": [
{
"text": "{{voicemember.name}}"
}
]
},
{
"tag": "span",
"part": "channel-member-muted",
"when": {
"path": "voicemember.status",
"equals": "muted"
},
"attributes": {
"aria-label": "麦克风已静音"
},
"children": [
{
"text": "已静音"
}
]
},
{
"tag": "span",
"part": "channel-member-away",
"when": {
"path": "voicemember.status",
"equals": "away"
},
"attributes": {
"aria-label": "离开"
},
"children": [
{
"text": "离开中"
}
]
},
{
"tag": "span",
"part": "channel-member-state",
"when": {
"path": "voicemember.self",
"equals": true
},
"children": [
{
"text": "你"
}
]
},
{
"tag": "span",
"part": "channel-member-state",
"when": {
"path": "voicemember.speaking",
"equals": true
},
"attributes": {
"aria-label": "正在讲话"
},
"children": [
{
"text": "●"
}
]
}
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"tag": "section",
"part": "conversation",
"attributes": {
"aria-label": "当前频道聊天 / Channel chat"
},
"children": [
{
"tag": "header",
"part": "conversation-heading",
"children": [
{
"tag": "span",
"part": "conversation-glyph",
"children": [
{
"text": "#"
}
],
"when": {
"path": "state.chatopen",
"equals": true
}
},
{
"tag": "h1",
"part": "channel-title",
"children": [
{
"text": "{{session.status.channelName}}"
}
],
"when": {
"path": "state.chatopen",
"equals": true
}
},
{
"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": "‹"
}
]
}
]
}
]
},
{
"tag": "div",
"part": "chat",
"children": [
{
"tag": "div",
"part": "chat-message-list",
"attributes": {
"aria-label": "当前频道消息 / Channel messages",
"role": "log",
"aria-live": "polite"
},
"children": [
{
"tag": "p",
"part": "chat-empty",
"when": {
"path": "chat.messages",
"empty": true
},
"children": [
{
"text": "还没有消息,向频道打个招呼吧。"
}
]
},
{
"tag": "article",
"part": "chat-message",
"repeat": {
"path": "chat.messages",
"as": "message"
},
"children": [
{
"tag": "span",
"part": "chat-message-avatar",
"attributes": {
"aria-hidden": "true"
},
"children": [
{
"text": "{{message.author}}"
}
]
},
{
"tag": "div",
"part": "chat-message-body",
"attributes": {
"data-kind": "{{message.kind}}"
},
"children": [
{
"tag": "header",
"part": "chat-message-heading",
"children": [
{
"tag": "strong",
"part": "chat-message-author",
"children": [
{
"text": "{{message.author}}"
}
]
},
{
"tag": "time",
"part": "chat-message-time",
"children": [
{
"text": "{{message.time}}"
}
]
}
]
},
{
"tag": "p",
"part": "chat-message-text",
"children": [
{
"text": "{{message.text}}"
}
]
}
]
}
]
}
]
},
{
"tag": "form",
"part": "chat-composer",
"events": {
"submit": "send-message"
},
"children": [
{
"tag": "input",
"part": "chat-input",
"bindValue": "message",
"attributes": {
"type": "text",
"maxlength": 1000,
"autocomplete": "off",
"placeholder": "给 #{{session.status.channelName}} 发消息",
"aria-label": "给 #{{session.status.channelName}} 发消息"
}
},
{
"tag": "button",
"part": "chat-send",
"attributes": {
"type": "submit",
"aria-label": "发送消息"
},
"children": [
{
"text": "发送"
}
]
}
]
}
],
"when": {
"path": "state.chatopen",
"equals": true
}
}
]
},
{
"tag": "aside",
"part": "voice-stage",
"attributes": {
"aria-label": "语音房间 / Voice room"
},
"children": [
{
"widget": "voice.member-cards",
"part": "member-cards"
},
{
"widget": "voice.screen-share-player",
"part": "screen-player"
},
{
"tag": "div",
"part": "whisper-controls",
"children": [
{
"tag": "button",
"part": "whisper-start",
"when": {
"path": "whisper.status.active",
"equals": false
},
"attributes": {
"type": "button",
"aria-label": "开始悄悄话"
},
"events": {
"click": "whisper-on"
},
"children": [
{
"text": "悄悄话"
}
]
},
{
"tag": "button",
"part": "whisper-stop",
"when": {
"path": "whisper.status.active",
"equals": true
},
"attributes": {
"type": "button",
"aria-label": "停止悄悄话"
},
"events": {
"click": "whisper-off"
},
"children": [
{
"text": "悄悄话中"
}
]
}
]
}
]
},
{
"tag": "footer",
"part": "voice-dock",
"attributes": {
"aria-label": "语音控制 / Voice controls"
},
"children": [
{
"tag": "div",
"part": "voice-dock-heading",
"children": [
{
"tag": "span",
"part": "connection-indicator",
"children": [
{
"text": "●"
}
]
},
{
"tag": "strong",
"part": "voice-channel-name",
"children": [
{
"text": "{{session.status.channelName}}"
}
]
},
{
"tag": "button",
"part": "disconnect-control",
"attributes": {
"type": "button",
"aria-label": "断开语音"
},
"events": {
"click": "disconnect"
},
"children": [
{
"text": "离开"
}
]
}
]
},
{
"tag": "div",
"part": "voice-dock-actions",
"children": [
{
"widget": "voice.screen-share-start",
"part": "screen-share-start"
},
{
"widget": "voice.audio-controls",
"part": "audio-controls"
}
]
}
]
},
{
"tag": "div",
"part": "identity-entry",
"when": {
"path": "session.status.userName"
},
"attributes": {
"role": "group",
"aria-label": "当前 TeamSpeak 身份"
},
"children": [
{
"tag": "span",
"part": "identity-monogram",
"children": [
{
"text": "TS"
}
]
},
{
"tag": "span",
"part": "identity-name",
"children": [
{
"text": "{{session.status.userName}}"
}
]
}
]
}
],
"attributes": {
"data-chat-open": "{{state.chatopen}}",
"data-voice-group-open": "{{state.voicegroupopen}}"
}
}
}
]
}