am-editor

A rich text editor that supports collaborative editing and allows for the free use of front-end common libraries such as React and Vue to extend and define plugins.

MIT License

Stars
919
Committers
22

Bot releases are visible (Hide)

am-editor - @aomao/[email protected]

Published by big-camel over 2 years ago

  • Text type links are not converted after pasting
  • Wrong focus & blur issue with multiple engine instances
am-editor - @aomao/[email protected]

Published by big-camel over 2 years ago

am-editor - @aomao/[email protected]

Published by big-camel over 2 years ago

  • If the image is selected and saved, there will be more resizer characters #143
  • The range is not preserved after the editor loses focus, so the next command execution will be in the wrong position #142
am-editor - @aomao/[email protected]

Published by big-camel over 2 years ago

  • Double-click to enlarge the picture in editing state, and click to enlarge the picture when previewing #141
  • After copying in the form, the next paste will carry the last copied content
am-editor - @aomao/[email protected]

Published by big-camel over 2 years ago

  • Read-only state, pause dom mutation monitoring
  • Code block copy lost cursor #132
  • Optimized performance (paste)
am-editor - @aomao/[email protected]

Published by big-camel over 2 years ago

  • Added iconFonts configuration option to solve the problem of loading icons in iconfont.cn address in limited network environment
  • Execute the codeblock plugin at the selected position and put the selected text into the codeblock #126
  • The code block is copied and then pasted without newlines
  • Add Engine instance parameter to onClick onSelect event of toolbar
  • Update related documentation
am-editor - @aomao/[email protected]

Published by big-camel over 2 years ago

  • Cannot copy inside code blocks
  • Can't parse empty table markdown
am-editor -

Published by big-camel over 2 years ago

Fixed

  • Lost focus in card does not trigger blur event #118
  • Cards cannot be dragged
  • The mark style cannot be applied to blank cells in the table
  • Add a type to the button button. When the form is embedded, the click will execute the submit behavior by default #121
  • table move loses nearby columns/rows after merging columns/rows
  • The difference between pasting markdown line breaks causes the parsing to fail
am-editor -

Published by big-camel over 2 years ago

Fixed

  • Paste and copy occasional struct nesting errors
  • Occasionally delete text errors in collaborative state
  • Modifying the card value will not trigger the change event
  • Optimize the cursor display of collaborators
  • Clicking the copy button in the card toolbar does not work
am-editor -

Published by big-camel over 2 years ago

fix: scroll bar cannot scroll to cursor position in some cases
refactor: change event fires twice
refactor: click no longer add a new line when the editing area is not in the editing state

am-editor -

Published by big-camel over 2 years ago

Improvements

  • Remove the bound event when the plugin destroys
  • Upload files based on mimeType
am-editor -

Published by big-camel over 2 years ago

Fixed

  • paste: In some cases when pasting, some nodes will be skipped and cannot be parsed
am-editor -

Published by big-camel over 2 years ago

Fixed

  • codeblock parsing markdown will be one less character
  • Add a blank line when clicking at the head and tail of the editor area
  • Rendering the card under readonly will lose the cursor nodes on the left and right sides of the card
  • Toolbar is not centered after image upload
am-editor -

Published by big-camel over 2 years ago

特征

解耦协作者光标,否则协作者的光标变化数据会被频繁写入数据库

  1. 需要在初始化时提供一个监听协作光标变化的方法,并且广播其给的协同光标数据

https://github.com/red-axe/am-editor/blob/master/examples/react/components/editor/ot/client.ts

// 实例化编辑器内部协同服务
this.engine.ot.initRemote(doc, defaultValue, (paths) => {
  this.broadcast('select', paths);
});
  1. 在接收到协作光标变化时,通过提供的 engine.ot.renderSelection api 绘制协作者的光标
// 广播信息,一个协作用户发送给全部协作者的广播
if ('broadcast' === action) {
  const { uuid, body, type } = data;
  // 如果接收者和发送者不是同一人就触发一个message事件,外部可以监听这个事件并作出响应
  if (uuid !== this.current?.uuid) {
      switch (type) {
      case 'select':
  	this.engine.ot.renderSelection(body);
  	break;
      default:
  	this.emit(EVENT.message, {
  		type,
  		body,
  	});
      }
  }
}

修复

  1. 在当前编辑环境中如果编辑器处于失去焦点的状态,那么协作者数据变化时,会被自动设置焦点到编辑器上
  2. typing 在 engine.destroy 中未销毁
am-editor -

Published by big-camel over 2 years ago

Fixed

  • ot: Multiplayer collaborative background will cause a horizontal scroll bar to appear

Improvements

  • video: increase the mask, and it will play immediately if it is not selected
  • image: add the maxHeight option, and images with a height greater than maxHeight will be scaled proportionally
am-editor -

Published by big-camel over 2 years ago

Features

  • Added getSelectionData api to editor
    • Use editor.getSelectionData() to get the text and html selected in the current editor
  • Added paste api to editor
    • Use engine.change.paste('HTML') to paste a piece of html in the current selection

Improvements

  • table When multiple people are collaboratively editing, clicking on the table will repeat the cursor information of the collaborators
am-editor -

Published by big-camel over 2 years ago

Improvements

  • table
    • Table card toolbar blocks delete buttons for table rows and columns
    • The cell is filled with block-level cards, and an empty row is added after clicking the cell
am-editor -

Published by big-camel over 2 years ago

Fixed

  • table: 火狐浏览器无法托选单元格 #97

Improvements

  • 优化卡片对外围大小变化的自适应
  • 优化协作相关
  • 优化视频相关
am-editor -

Published by big-camel over 2 years ago

Fixed

  • engine 空值情况下编辑可能会出现不符合预期的div节点

Improvements

  • table 调整工具栏右键打开菜单栏时的位置
  • paste 优化粘贴的精准性
  • ot & card 协同编辑情况下,卡片节点的属性发生变化将不再触发可编辑卡片重绘
am-editor -

Published by big-camel over 2 years ago

Features

  • card.parserHtml 增加回调函数,通过继承重写 parserHtml 方法转换卡片为html更快捷

Fixed

  • plugin-math 多个请求导致只能渲染一个math卡片
  • scrollbar 滚动条在比较时在1px以下的差异,导致出现不必要的滚动条
  • mark mark节点类型执行wrapByNode的时会重复包裹相同的插件
  • plugin-mention 鼠标在列表上移动失去了背景颜色变化