aieditor-team / aieditor Goto Github PK
View Code? Open in Web Editor NEWAiEditor is a next-generation rich text editor for AI. (AiEditor 是一个面向 AI 的下一代富文本编辑器。)
Home Page: https://AiEditor.dev
License: GNU Lesser General Public License v2.1
AiEditor is a next-generation rich text editor for AI. (AiEditor 是一个面向 AI 的下一代富文本编辑器。)
Home Page: https://AiEditor.dev
License: GNU Lesser General Public License v2.1
试用了一下,目前还存在3个大问题希望后续作者能改善:
1、AI翻译时会破坏格式,同时翻译内容会出错,建议可以自定义国内或免费的翻译API接口功能。
2、从网页上复制,再到AiEditor中粘贴时,只能粘贴出文字内容,无法粘贴图片或其它格式。
3、后续可否打包成 exe 或 单文件本地运行?
目前很棒的功能:
1、格式刷功能。
2、字体选择和高亮颜色选择。
3、集成AI功能(还需进一步优化),最好还加上代码补充注释功能。
谢谢!
After trying it out, there are still three big problems that I hope the author can improve in the future:
Great features so far:
Thanks!
I think it’s better if the extension is configurable
onMounted(() => {
aiEditor = new AiEditor({
theme: isDark.value ? 'dark' : 'light',
element: editorRef.value as Element,
placeholder: '点击输入内容...',
content:
'<video controls="true" poster="" width="350"><source src="http://127.0.0.1:5020/storage/2023-12/15/1702605335727.mp4"></video>'
})
})
默认值会有一个“
”的空值,在表单校验必填中其实什么也没输入,但是校验能通过项目挺不错的,我在找一个自用的富文本编辑器,目前看到是星火的,希望能加一个切换其他模型的,方便对比内容。
如果支持,我可以帮忙把其他模型接进来,这是我写的 通用 AI SDK 模块,但可以直接将代码集成进来,而不是模块。
可参考我给同类的 unit-mesh/b3 项目,就是直接代码迁移过去使用的。
现在感觉onUploadBefore这个钩子没用,希望能做成return false就会阻止上传,比如图片上传的太大了就要取消上传
在vue中切换主题都是手动去点的,可能aieditor已经渲染完成了,这时候需要手动去修改主题色。
Module parse failed: Unexpected token (16:28)
File was processed with these loaders:
element: divRef.value as Element,
| placeholder: "点击输入内容...",
| content: 'AiEditor 是一个面向 AI 的开源富文本编辑器。 ',
The document is described as follows :
new AiEditor({
element: "#aiEditor",
ai:{
model:{
xinghuo:{
appId: "****",
urlSignatureAlgorithm: async (model)=>{
// 通过后端进行 URL 签名,并返回签名完成的 URL 地址
return await fetch("/your-path/model?appId="+model.appId)
.then(resp=>resp.json)
.then(json=>json.url)
}
}
}
},
})
The type of urlSignatureAlgorithm here is (model: XingHuoModel) => Promise<string>
https://github.com/aieditor-team/AiEditor/blob/main/src/ai/xinghuo/XingHuoModel.ts#L40
startWithProcessor(selectedText: string, prompt: string, processor: AiMessageProcessor): void {
const url = this.urlSignatureAlgorithm ? this.urlSignatureAlgorithm(this) : this.createUrl();
this.socket = new XingHuoSocket(url, processor, this.appId, this.version);
for (let listener of this.listeners) {
this.socket.addListener(listener);
}
this.socket.start(`${selectedText}\n${prompt}`)
}
Here, there is no waiting for the Promise to be evaluated, so it is impossible to obtain the pre-fetched result.
这样可以自己修改代码,markdown 方式也行
场景应该是垂直行业内部编辑功能,希望能调用接口来补全语句,或者根据一些内部文档来生成一些段落等!
在网页上嵌入:lxgw/LxgwWenKai#24
现在微信读书也支持这个字体
空值合并操作符 写法在一些老项目中无法被编译识别,可以优化成三目运算。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.