{"_id":"@bylqwjc/media-editor-react","name":"@bylqwjc/media-editor-react","dist-tags":{"latest":"1.0.12"},"versions":{"1.0.12":{"name":"@bylqwjc/media-editor-react","version":"1.0.12","description":"媒体编辑器 React 适配：useVideoEditor hook（绑定 VideoEditorEngine）+ <ImageEditor>（薄包 @media-editor/image）+ 参考视频 UI","type":"module","license":"MIT","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./style.css":"./style.css","./theme.css":"./theme.css","./filerobot.css":"./filerobot.css"},"publishConfig":{"access":"public"},"peerDependencies":{"react":"^18.2.0 || ^19.0.0","react-dom":"^18.2.0 || ^19.0.0"},"dependencies":{"@media-editor/client":"workspace:*","@media-editor/core":"workspace:*","@media-editor/image":"workspace:*","@media-editor/video":"workspace:*"},"bundleDependencies":["@media-editor/client","@media-editor/core","@media-editor/image","@media-editor/video"],"sideEffects":["*.css"],"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","_id":"@bylqwjc/media-editor-react@1.0.12","gitHead":"3365c752b348361f4a5579a0e3342a51c6d0112e","_nodeVersion":"22.14.0","_npmVersion":"11.2.0","dist":{"integrity":"sha512-vwf53UyHzrTEd6ng9hK0fr48jeaFmd73hoxjvnTL8lKFpoUmWJgqwMQJZg/jZyXVI8JvVDOmD1lWXrIAk/417Q==","shasum":"6c3fa3706048116f619f494c083917ff838ff437","tarball":"https://registry.npmjs.org/@bylqwjc/media-editor-react/-/media-editor-react-1.0.12.tgz","fileCount":434,"unpackedSize":4963378,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID375ig3KoOhrQeyorp0Le/Ew5nzxgui+ESK0GzD0PF8AiEA1Hzg9wBaGd2aGpxCwx+mzide/HgHe+fuifadaBJRZQs="}]},"_npmUser":{"name":"bylqwjc","email":"2337208618@qq.com"},"directories":{},"maintainers":[{"name":"bylqwjc","email":"2337208618@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/media-editor-react_1.0.12_1782876458792_0.7054874691932993"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-01T03:27:38.638Z","1.0.12":"2026-07-01T03:27:38.940Z","modified":"2026-07-01T03:27:39.142Z"},"maintainers":[{"name":"bylqwjc","email":"2337208618@qq.com"}],"description":"媒体编辑器 React 适配：useVideoEditor hook（绑定 VideoEditorEngine）+ <ImageEditor>（薄包 @media-editor/image）+ 参考视频 UI","license":"MIT","readme":"# @bylqwjc/media-editor-react\n\nReact 适配包，提供 `MediaEditor`、`ImageEditor`、`VideoEditor` 和 `useVideoEditor`。\n\n## 安装\n\n```bash\npnpm add @bylqwjc/media-editor-react\n```\n\nReact 和 ReactDOM 是 peer dependency，需要由业务应用提供。\n\n`locale` 支持 `zh`、`en`、`es` 和 `zh-Hant`。\n\n## 示例\n\n```tsx\nimport { ImageEditor, VideoEditor } from '@bylqwjc/media-editor-react';\nimport '@bylqwjc/media-editor-react/theme.css';\nimport '@bylqwjc/media-editor-react/filerobot.css';\nimport '@bylqwjc/media-editor-react/style.css';\n\nexport function Editor({ type, source }: { type: 'image' | 'video'; source?: string | File }) {\n  if (type === 'image') {\n    return <ImageEditor source={source} locale=\"zh\" theme=\"auto\" onSave={saveImageToYourApp} />;\n  }\n  return (\n    <VideoEditor\n      source={source instanceof File ? source : undefined}\n      baseUrl=\"/api/editor\"\n      locale=\"zh\"\n      theme=\"auto\"\n      onExported={saveVideoToYourApp}\n    />\n  );\n}\n```\n\n## 统一入口\n\n```tsx\nimport { MediaEditor } from '@bylqwjc/media-editor-react';\n\n<MediaEditor\n  baseUrl=\"/api/editor\"\n  locale=\"zh\"\n  theme=\"auto\"\n  onImageSave={saveImageToYourApp}\n  onExported={(blob) => saveVideoToYourApp(blob, 'video.mp4')}\n/>;\n```\n","readmeFilename":"README.md","_rev":"1-a63a6fbf490a44eca5eb0a2122402781"}