简体   繁体   English

实时协作富文本编辑

[英]Real-time collaborative rich text editing

I would like to have a real-time collaborative rich text editor for my webapp.我想为我的 web 应用程序提供一个实时协作的富文本编辑器。 So far i've done a LOT of research and i'm really a bit frustrated that there is nothing fitting out there.到目前为止,我已经做了很多研究,我真的有点沮丧,因为那里没有合适的东西。 The thing is, that every solution out there is tightly coupled to an editor (Firepad for example uses CodeMirror/ Etherpad uses Etherpad).问题是,那里的每个解决方案都与编辑器紧密耦合(例如 Firepad 使用 CodeMirror/Etherpad 使用 Etherpad)。 There are only two other solutions i found interesting:我发现有趣的只有另外两个解决方案:

  • ShareJs -> works only for plain text ShareJs -> 仅适用于纯文本

  • Webstrate -> This was the MOST promising to me. Webstrate -> 这对我来说是最有希望的。 It can handle DOM synchronization and therefore it can handle every contenteditable - great!它可以处理 DOM 同步,因此它可以处理每个 contenteditable - 太棒了!

But the problem with Webstrate is, that it is in an alpha Version.但 Webstrate 的问题在于,它处于 alpha 版本。 So for me it was too buggy - didn't work out.所以对我来说这太有问题了 - 没有成功。 Tried to get it working for about 2 days.试图让它工作大约 2 天。 The text synchronization was easy.文本同步很容易。 But it didn't work with iframes or other stuff.但它不适用于 iframe 或其他东西。

My claims are pretty high for a collaborative RTE - it should support:我对协作 RTE 的要求非常高 - 它应该支持:

  • Images图片

  • Iframes内嵌框架

  • Video视频

  • Text (of course)文字(当然)

While i'm searching for about 3-4 days now for a solution - maybe someone of you has a hint?虽然我现在正在寻找大约 3-4 天的解决方案 - 也许你们中的某个人有提示? Would be very gentle ;)会很温柔;)

The closest thing I found is http://quilljs.com/ - it has an API for getting and updating text deltas and also for getting and setting multiple labeled cursors.我找到的最接近的东西是http://quilljs.com/ - 它有一个 API 用于获取和更新文本增量以及用于获取和设置多个标记光标。 It doesn't manage the real-time editing for you, but it gives you enough to work with (more than any other project I found).它不会为您管理实时编辑,但它为您提供了足够的工作(比我发现的任何其他项目都要多)。 However it is not as comprehensive as other editors in formatting (for example, it doesn't support tables and nested lists).然而,它在格式方面不如其他编辑器全面(例如,它不支持表格和嵌套列表)。 It is somewhat extensible, so you may be able to add support for additional HTML elements.它具有一定的可扩展性,因此您可以添加对其他 HTML 元素的支持。

You can try http://swellrt.org , is a complete framework to develop real-time collaborative apps including rich-text support and an editor for Web.您可以尝试http://swellrt.org ,它是一个完整的框架,用于开发实时协作应用程序,包括富文本支持和 Web编辑器

It provides a JS API, analogue to GD Real-time API, plus rich-text editting.它提供了一个 JS API,类似于 GD 实时 API,加上富文本编辑。

The editor can be extended to support any attachment.编辑器可以扩展以支持任何附件。

It's a fork of Apache Wave that generalizes the original code.它是Apache Wave的一个分支,它概括了原始代码。

Robust collaborative rich text editors are still somewhat bleeding edge.强大的协作富文本编辑器仍然有些前沿。 Most web based text editors fall into of two categories.大多数基于 Web 的文本编辑器分为两类。

  1. Those that are compatible with real time collaboration but have fairly limited functionality (eg no tables, no nested elements, etc.).那些与实时协作兼容但功能相当有限的(例如,没有表格、没有嵌套元素等)。
  2. Those that are very robust web based rich text editors, but lack that API to integrate with real time technologies.那些基于 Web 的非常强大的富文本编辑器,但缺乏与实时技术集成的 API。

Then there are the collaboration engines like ShareDB, Google Drive Realtime API, SwellRT, and Convergence (full disclosure I am a founder at Convergence Labs ).然后是协作引擎,如 ShareDB、Google Drive Realtime API、SwellRT 和Convergence (完全披露我是Convergence Labs的创始人)。 These types of systems each have their own opinion on data models and how to mediate collaboration.这些类型的系统对数据模型以及如何协调协作都有自己的看法。 It may be the case that the way your favorite rich text editor works internally is incompatible with the API of the collaboration engine.可能是您最喜欢的富文本编辑器在内部工作的方式与协作引擎的 API 不兼容。

The technologies out there that simply sync the DOM are interesting because they are often portable across editors and are less dependent on the editor API, but they tend to lack a lot of the required real time editing capabilities that are required for good collaboration (shared cursors, shared selections, etc.).那些简单地同步 DOM 的技术很有趣,因为它们通常可以跨编辑器移植,并且对编辑器 API 的依赖程度较低,但它们往往缺乏良好协作所需的大量实时编辑功能(共享游标、共享选择等)。 This can be very hard to implement on top of a DOM syncing approach from outside of the engine itself.这可能很难在引擎本身外部的 DOM 同步方法之上实现。 Unfortunately, without these features, the collaborative editing experience is not that great.不幸的是,如果没有这些功能,协作编辑体验就不那么好了。

There are several projects out there that are attempting to remedy this situation.有几个项目正试图纠正这种情况。 The folks at CKEditor are working on CKEditor 5 which has collaboration in mind. CKEditor 的人正在研究 CKEditor 5,它考虑到了协作。 Also, over at Convergence we are trying to work with the authors of many of the popular editors to enable real time collaboration.此外,在 Convergence,我们正尝试与许多流行编辑器的作者合作,以实现实时协作。

The reality is that it is still a pretty new space and evolving quickly.现实情况是,它仍然是一个相当新的空间,并且发展迅速。 There is no tested, scalable, slam dunk solution that provides and out of the box fully capable, collaborative, free and open source editor.没有经过测试、可扩展的灌篮解决方案,提供开箱即用的全功能、协作、免费和开源编辑器。 The situation looks to be improving over 2018. Hopefully in the next 12-24 months this becomes a much easier problem. 2018 年情况似乎有所改善。希望在接下来的 12 到 24 个月内,这将成为一个容易得多的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM