自定义消息

This commit is contained in:
pengxiaolong
2025-05-16 21:53:47 +08:00
parent 595c5329a0
commit e05d72fccf
43 changed files with 458 additions and 84 deletions

View File

@@ -1 +1 @@
{"version":3,"file":"config.js","sources":["TUIKit/components/TUIChat/config.ts"],"sourcesContent":["class TUIChatConfig {\n static instance: TUIChatConfig;\n private chatType: string;\n private features: Record<string, any>;\n private theme: string;\n constructor() {\n this.chatType = '';\n this.features = {\n DownloadFile: true,\n CopyMessage: true,\n DeleteMessage: true,\n RevokeMessage: true,\n QuoteMessage: true,\n ForwardMessage: true,\n TranslateMessage: true,\n VoiceToText: true,\n MultiSelection: true,\n EmojiReaction: true,\n InputEmoji: true,\n InputStickers: true,\n InputImage: true,\n InputVoice: true,\n InputVideo: true,\n InputFile: true,\n InputEvaluation: true,\n InputQuickReplies: true,\n InputMention: true,\n MessageSearch: true,\n ReadStatus: true,\n };\n this.theme = 'light';\n }\n\n static getInstance(): TUIChatConfig {\n if (!TUIChatConfig.instance) {\n TUIChatConfig.instance = new TUIChatConfig();\n }\n return TUIChatConfig.instance;\n }\n\n setChatType(chatType: string) {\n this.chatType = chatType;\n }\n\n getChatType() {\n return this.chatType;\n }\n\n hideTUIChatFeatures(features: string[]) {\n if (!features) {\n return;\n }\n features.forEach((feature: string) => {\n if (this.features[feature]) {\n this.features[feature] = false;\n }\n });\n }\n\n getFeatureConfig(key?: string) {\n if (key) {\n return this.features[key];\n }\n return this.features;\n }\n\n setTheme(theme: string) {\n this.theme = theme;\n }\n\n getTheme() {\n return this.theme;\n }\n}\n\nconst ChatConfig = TUIChatConfig.getInstance();\nconst hideTUIChatFeatures = ChatConfig.hideTUIChatFeatures.bind(ChatConfig);\n\nexport {\n hideTUIChatFeatures,\n};\n\nexport default ChatConfig;\n"],"names":[],"mappings":";AAAA,MAAM,cAAc;AAAA,EAKlB,cAAc;AACZ,SAAK,WAAW;AAChB,SAAK,WAAW;AAAA,MACd,cAAc;AAAA,MACd,aAAa;AAAA,MACb,eAAe;AAAA,MACf,eAAe;AAAA,MACf,cAAc;AAAA,MACd,gBAAgB;AAAA,MAChB,kBAAkB;AAAA,MAClB,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,eAAe;AAAA,MACf,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,iBAAiB;AAAA,MACjB,mBAAmB;AAAA,MACnB,cAAc;AAAA,MACd,eAAe;AAAA,MACf,YAAY;AAAA,IAAA;AAEd,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,OAAO,cAA6B;AAC9B,QAAA,CAAC,cAAc,UAAU;AACb,oBAAA,WAAW,IAAI;IAC/B;AACA,WAAO,cAAc;AAAA,EACvB;AAAA,EAEA,YAAY,UAAkB;AAC5B,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,cAAc;AACZ,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,oBAAoB,UAAoB;AACtC,QAAI,CAAC,UAAU;AACb;AAAA,IACF;AACS,aAAA,QAAQ,CAAC,YAAoB;AAChC,UAAA,KAAK,SAAS,OAAO,GAAG;AACrB,aAAA,SAAS,OAAO,IAAI;AAAA,MAC3B;AAAA,IAAA,CACD;AAAA,EACH;AAAA,EAEA,iBAAiB,KAAc;AAC7B,QAAI,KAAK;AACA,aAAA,KAAK,SAAS,GAAG;AAAA,IAC1B;AACA,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,SAAS,OAAe;AACtB,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,WAAW;AACT,WAAO,KAAK;AAAA,EACd;AACF;AAEM,MAAA,aAAa,cAAc,YAAY;AACjB,WAAW,oBAAoB,KAAK,UAAU;;"}
{"version":3,"file":"config.js","sources":["TUIKit/components/TUIChat/config.ts"],"sourcesContent":["class TUIChatConfig {\n static instance: TUIChatConfig;\n private chatType: string;\n private features: Record<string, any>;\n private theme: string;\n constructor() {\n this.chatType = '';\n this.features = {\n DownloadFile: true,\n CopyMessage: true,\n DeleteMessage: true,\n RevokeMessage: true,\n QuoteMessage: true,\n ForwardMessage: true,\n TranslateMessage: true,\n VoiceToText: true,\n MultiSelection: true,\n EmojiReaction: true,\n InputEmoji: true,\n InputStickers: true,\n InputImage: true,\n InputVoice: true,\n InputVideo: true,\n InputFile: true,\n InputEvaluation: true,\n InputQuickReplies: true,\n InputCustomMessage:true,\n InputMention: true,\n MessageSearch: true,\n ReadStatus: true,\n };\n this.theme = 'light';\n }\n\n static getInstance(): TUIChatConfig {\n if (!TUIChatConfig.instance) {\n TUIChatConfig.instance = new TUIChatConfig();\n }\n return TUIChatConfig.instance;\n }\n\n setChatType(chatType: string) {\n this.chatType = chatType;\n }\n\n getChatType() {\n return this.chatType;\n }\n\n hideTUIChatFeatures(features: string[]) {\n if (!features) {\n return;\n }\n features.forEach((feature: string) => {\n if (this.features[feature]) {\n this.features[feature] = false;\n }\n });\n }\n\n getFeatureConfig(key?: string) {\n if (key) {\n return this.features[key];\n }\n return this.features;\n }\n\n setTheme(theme: string) {\n this.theme = theme;\n }\n\n getTheme() {\n return this.theme;\n }\n}\n\nconst ChatConfig = TUIChatConfig.getInstance();\nconst hideTUIChatFeatures = ChatConfig.hideTUIChatFeatures.bind(ChatConfig);\n\nexport {\n hideTUIChatFeatures,\n};\n\nexport default ChatConfig;\n"],"names":[],"mappings":";AAAA,MAAM,cAAc;AAAA,EAKlB,cAAc;AACZ,SAAK,WAAW;AAChB,SAAK,WAAW;AAAA,MACd,cAAc;AAAA,MACd,aAAa;AAAA,MACb,eAAe;AAAA,MACf,eAAe;AAAA,MACf,cAAc;AAAA,MACd,gBAAgB;AAAA,MAChB,kBAAkB;AAAA,MAClB,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,eAAe;AAAA,MACf,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,iBAAiB;AAAA,MACjB,mBAAmB;AAAA,MACnB,oBAAmB;AAAA,MACnB,cAAc;AAAA,MACd,eAAe;AAAA,MACf,YAAY;AAAA,IAAA;AAEd,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,OAAO,cAA6B;AAC9B,QAAA,CAAC,cAAc,UAAU;AACb,oBAAA,WAAW,IAAI;IAC/B;AACA,WAAO,cAAc;AAAA,EACvB;AAAA,EAEA,YAAY,UAAkB;AAC5B,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,cAAc;AACZ,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,oBAAoB,UAAoB;AACtC,QAAI,CAAC,UAAU;AACb;AAAA,IACF;AACS,aAAA,QAAQ,CAAC,YAAoB;AAChC,UAAA,KAAK,SAAS,OAAO,GAAG;AACrB,aAAA,SAAS,OAAO,IAAI;AAAA,MAC3B;AAAA,IAAA,CACD;AAAA,EACH;AAAA,EAEA,iBAAiB,KAAc;AAC7B,QAAI,KAAK;AACA,aAAA,KAAK,SAAS,GAAG;AAAA,IAC1B;AACA,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,SAAS,OAAe;AACtB,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,WAAW;AACT,WAAO,KAAK;AAAA,EACd;AACF;AAEM,MAAA,aAAa,cAAc,YAAY;AACjB,WAAW,oBAAoB,KAAK,UAAU;;"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long