GitHub - levodoubt/qwenpaw-longtext-input · GitHub
Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

📝 长文本输入插件 (qwenpaw-longtext-input)

在 QwenPaw 输入框左下角新增「长文本」按钮,点击弹出编辑器,保存后自动注入官方附件上传流,文件以 uuid_标题_时间戳.txt 格式存入 media/,行为与手动点击 📎 按钮选择文件完全一致。

效果

┌──────────────────────────────────────────┐
│  📝 长文本输入                            │
│  ┌─────────────────────────────────────┐ │
│  │ 🏷 标题(可选,将出现在文件名中)     │ │
│  ├─────────────────────────────────────┤ │
│  │                                     │ │
│  │  正文编辑区域 …                      │ │
│  │                                     │ │
│  └─────────────────────────────────────┘ │
│  [取消]                    [保存并加入附件] │
└──────────────────────────────────────────┘

保存后,文件出现在输入框上方的附件列表中,文件名格式:

标题 上传后文件名
会议记录 <uuid>_会议记录_1782815000000.txt
(空) <uuid>_长文本_1782815000000.txt

安装

# ① 克隆
git clone https://github.com/levodoubt/qwenpaw-longtext-input.git
cd qwenpaw-longtext-input

# ② 构建前端
npm install && npm run build

# ③ 安装到 QwenPaw
qwenpaw plugin install .

使用

  1. 打开聊天页面,输入框左下角出现「长文本」按钮
  2. 点击 → 弹出编辑器
  3. 可选输入标题(会出现在文件名中)
  4. 输入正文 → 点击「保存并加入附件」
  5. 文件自动出现在附件列表中,可直接发送

原理

  • 按钮通过 DOM 注入放置在输入框左下角,与语音/附件按钮并列
  • 编辑器使用宿主提供的 antd Modal + TextArea
  • 保存时创建 File 对象,通过原生 input[type="file"] setter 注入官方附件流
  • 后续上传、列表展示、随消息发送均由 QwenPaw 原生附件系统处理

开发

npm run dev    # 开发模式(watch)
npm run build  # 生产构建

构建产物为 dist/index.js。

许可证

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages