feat: 新增 /拍一拍 功能 + 斜杠命令菜单

- 输入框输入 / 弹出命令菜单,当前支持 /拍一拍
- 选择对象后输入 /拍一拍 发送拍一拍通知
- 所有在线用户屏幕抖动 + 正常聊天样式显示消息
- 命令注册表可扩展,后续新增命令只需 push 到数组
This commit is contained in:
pllx
2026-04-28 22:59:16 +08:00
parent 0dd85879af
commit 495efdf9e0
10 changed files with 613 additions and 0 deletions
+11
View File
@@ -288,9 +288,18 @@ import { leaveRoom, notifyExpiredLeave, saveExp, startHeartbeat, stopHeartbeat }
import { bindToolbarControls, runFeatureShortcut, runToolbarAction } from "./chat-room/toolbar.js";
import { bindChatInitialStateControls } from "./chat-room/initial-state.js";
// 拍一拍模块
import "./chat-room/pat.js";
// 斜杠命令菜单
import { bindSlashCommands, registerSlashCommand } from "./chat-room/slash-commands.js";
if (typeof window !== "undefined") {
bindInstantHoverTooltip();
// 初始化斜杠命令菜单
bindSlashCommands();
// 保留聚合入口,懒加载模块通过按需动态导入自动初始化。
window.ChatRoomTools = {
// ── 静态核心模块(直接引用) ────────────────
@@ -469,6 +478,7 @@ if (typeof window !== "undefined") {
bindWelcomeMenuControls,
toggleWelcomeMenu,
bindAdminMenuControls,
registerSlashCommand,
bindBaccaratEvents,
bindBaccaratLossCoverAdminControls,
closeAdminBaccaratLossCoverModal,
@@ -680,6 +690,7 @@ if (typeof window !== "undefined") {
window.loadFeedbackData = loadFeedbackData;
window.loadMoreFeedback = loadMoreFeedback;
window.bindFeedbackControls = bindFeedbackControls;
window.registerSlashCommand = registerSlashCommand;
// ── Alpine 组件(静态导入,Blade 中 x-data 引用时同步可用) ──
window.userCardComponent = userCardComponent;