{"editorState":{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"创建插件","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"heading","version":1,"tag":"h1"},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"最简单的插件是一个接受实例并返回清理函数的函数。","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"计划插入组件因此使用DecoratorNode。","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"export","type":"code-highlight","version":1,"highlightType":"keyword"},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"code-highlight","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":"class","type":"code-highlight","version":1,"highlightType":"keyword"},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"code-highlight","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":"ImageNode","type":"code-highlight","version":1,"highlightType":"class-name"},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"code-highlight","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":"extends","type":"code-highlight","version":1,"highlightType":"keyword"},{"detail":0,"format":0,"mode":"normal","style":"","text":" ","type":"code-highlight","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":"DecoratorNode","type":"code-highlight","version":1,"highlightType":"class-name"}],"direction":"ltr","format":"","indent":0,"type":"code","version":1,"language":"javascript"},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"必须方法","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"heading","version":1,"tag":"h2"},{"children":[{"children":[{"detail":0,"format":16,"mode":"normal","style":"","text":"constructor(...)","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" + class props – Allows us to store custom data within nodes at runtime as well as accept custom parameters.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":1},{"children":[{"detail":0,"format":16,"mode":"normal","style":"","text":"getType()","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" & ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"clone(...)","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" – methods allow Lexical to correctly identify node type as well as being able to clone it correctly as we may want to customize cloning behavior.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":2},{"children":[{"detail":0,"format":16,"mode":"normal","style":"","text":"importJSON(...)","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" & ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"exportJSON()","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" – define how our data will be serialized / deserialized to/from Lexical state. Here you define your node presentation in state.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":3},{"children":[{"detail":0,"format":16,"mode":"normal","style":"","text":"createDOM(...)","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" – defines DOM that will be rendered by Lexical","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":4}],"direction":"ltr","format":"","indent":0,"type":"list","version":1,"listType":"bullet","start":1,"tag":"ul"},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"节点转换","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"heading","version":1,"tag":"h1"},{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Attempt to transform ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"TextNode","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":". It will be run on any change to ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"TextNode","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":"'s.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Check if emoji shortcodes (smiles) are present in the text within ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"TextNode","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":". Skip if none.","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":2},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Split ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"TextNode","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" into 2 or 3 pieces (depending on the position of the shortcode in text) so target emoji shortcode has own dedicated ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"TextNode","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":3},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Replace emoji shortcode ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"TextNode","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" with ","type":"text","version":1},{"detail":0,"format":16,"mode":"normal","style":"","text":"EmojiNode","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":4}],"direction":"ltr","format":"","indent":0,"type":"list","version":1,"listType":"number","start":1,"tag":"ol"},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"放在一起执行","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"heading","version":1,"tag":"h1"},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"注册节点","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1},{"children":[],"direction":null,"format":"","indent":0,"type":"paragraph","version":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"图片现有功能","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"heading","version":1,"tag":"h1"},{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"shift+点击选中与取消选中","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"添加图片中注释","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":2},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"选中后可拖动","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":3},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"选中后可放大与缩小","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":4}],"direction":"ltr","format":"","indent":0,"type":"list","version":1,"listType":"number","start":1,"tag":"ol"},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"图片希望增加功能","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"heading","version":1,"tag":"h1"},{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"预览","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":1},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"删除图片中注释","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":2},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"图片说明占据大部分图片无法选择图片","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":3},{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"希望图片接近无限放大缩小","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"listitem","version":1,"value":4}],"direction":"ltr","format":"","indent":0,"type":"list","version":1,"listType":"number","start":1,"tag":"ol"},{"children":[],"direction":null,"format":"","indent":0,"type":"paragraph","version":1}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}}