
Research
/Security News
Popular Go Decimal Library Targeted by Long-Running Typosquat with DNS Backdoor
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.
yuque-editor
Advanced tools
基于 LakeX 的强大的所见即所得编辑器,提供了编辑器、查看器和切换组件三个核心功能。
# 安装编辑器
npm install yuque-editor
# 安装必需的 peer dependencies
npm install react react-dom @alipay/lakex @alipay/lakex-core
import { YuqueEditor, YuqueViewer, YuqueToggle } from 'yuque-editor';
// 导入样式
import '@alipay/lakex/dist/index.css';
import 'yuque-editor/dist/style.css';
// 使用编辑器
function MyEditor() {
return (
<YuqueEditor
defaultValue="<p>初始内容</p>"
onChange={(content) => console.log('内容变化:', content)}
config={{
// 自定义配置
uploadImage: async (file) => {
// 实现您的图片上传逻辑
return {
url: '图片URL',
name: file.name
};
}
}}
/>
);
}
// 使用查看器
function MyViewer() {
return (
<YuqueViewer
value="<p>要展示的内容</p>"
/>
);
}
// 使用切换组件
function MyToggle() {
return (
<YuqueToggle
value="<p>内容</p>"
onChange={(content) => console.log('内容变化:', content)}
defaultMode="view"
/>
);
}
编辑器组件,提供富文本编辑功能。
| 属性名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| defaultValue | string | '<p>欢迎使用编辑器</p>' | 编辑器的初始内容 |
| onChange | (value: string) => void | - | 内容变化时的回调函数 |
| className | string | - | 自定义类名 |
| style | React.CSSProperties | - | 自定义样式 |
| config | object | - | LakeX 编辑器配置项 |
查看器组件,用于展示富文本内容。
| 属性名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| value | string | - | 要展示的内容 |
| className | string | - | 自定义类名 |
| style | React.CSSProperties | - | 自定义样式 |
切换组件,支持编辑器和查看器之间的切换。
| 属性名 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| value | string | - | 内容 |
| onChange | (value: string) => void | - | 内容变化时的回调函数 |
| defaultMode | 'edit' | 'view' | 'view' | 默认模式 |
| className | string | - | 自定义类名 |
| style | React.CSSProperties | - | 自定义样式 |
为了保持包的轻量级:
# 安装依赖
npm install
# 启动开发服务器
npm run dev
# 构建
npm run build
欢迎提交 Issue 和 Pull Request。
MIT License
FAQs
A powerful WYSIWYG editor based on LakeX
The npm package yuque-editor receives a total of 1 weekly downloads. As such, yuque-editor popularity was classified as not popular.
We found that yuque-editor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A long-running Go typosquat impersonated the popular shopspring/decimal library and used DNS TXT records to execute commands.

Research
Active npm supply chain attack compromises @antv packages in a fast-moving malicious publish wave tied to Mini Shai-Hulud.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.