Skip to content

Releases: red-axe/am-editor

@aomao/[email protected]

09 Mar 07:11
Compare
Choose a tag to compare

Improvements

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

@aomao/[email protected]

08 Mar 03:03
Compare
Choose a tag to compare

Fixed

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

@aomao/[email protected]

05 Mar 13:24
Compare
Choose a tag to compare

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

@aomao/[email protected]

03 Mar 08:15
Compare
Choose a tag to compare

特征

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

  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 中未销毁

@aomao/[email protected]

01 Mar 06:44
Compare
Choose a tag to compare

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

@aomao/[email protected]

27 Feb 04:47
Compare
Choose a tag to compare

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

@aomao/[email protected]

23 Feb 15:48
Compare
Choose a tag to compare

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

@aomao/[email protected]

21 Feb 08:56
Compare
Choose a tag to compare

Fixed

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

Improvements

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

@aomao/[email protected]

18 Feb 06:53
Compare
Choose a tag to compare

Fixed

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

Improvements

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

@aomao/[email protected]

15 Feb 16:57
Compare
Choose a tag to compare

Features

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

Fixed

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