aden-editor-vue 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs +6 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +6 -1
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ const content = ref('<p>欢迎使用 AdenEditor</p>');
|
|
|
41
41
|
|
|
42
42
|
默认工具栏和样式会自动加载。未传 `options` 时,文字编辑、列表、引用、表格等内置功能仍可直接使用;无需单独导入 CSS,也无需自己处理创建、挂载和卸载。
|
|
43
43
|
|
|
44
|
-
带 HTML 格式的粘贴会以可编辑的富文本片段导入,尽量保留段落、表格、内联格式和可安全转换的样式;Word 内容不是嵌入的 Word
|
|
44
|
+
带 HTML 格式的粘贴会以可编辑的富文本片段导入,尽量保留段落、表格、内联格式和可安全转换的样式;Word 内容不是嵌入的 Word 文档。编辑器会同时检查粘贴事件与异步 Clipboard API 提供的图片/RTF 数据,提取 PNG/JPEG,并将 EMF/WMF 转为 PNG 后交给 `uploadImage`。Word 中使用 Ctrl+A 全选复制时,剪贴板仍可能只提供图片引用、不含图片数据;若浏览器没有暴露 RTF 或图片文件,网页端无法访问 Word 的本地临时图片路径。
|
|
45
45
|
|
|
46
46
|
## 保存内容
|
|
47
47
|
|
package/dist/index.cjs
CHANGED
|
@@ -23791,7 +23791,7 @@ var WebAdapter = class {
|
|
|
23791
23791
|
}
|
|
23792
23792
|
if (unresolvedImages > 0) {
|
|
23793
23793
|
const hasMetafile = files.some((file) => /(?:emf|wmf)/i.test(file.type));
|
|
23794
|
-
showToast(hasMetafile ? "\u5DF2\u4ECE Word \u526A\u8D34\u677F\u53D6\u5230 EMF/WMF \u56FE\u7247\uFF0C\u4F46\u683C\u5F0F\u8F6C\u6362\u5931\u8D25\u3002\u8BF7\u91CD\u65B0\u590D\u5236\uFF0C\u6216\u5728 Word \u4E2D\u53F3\u952E\u56FE\u7247\u9009\u62E9\u201C\u590D\u5236\u56FE\u7247\u201D\u540E\u5355\u72EC\u7C98\u8D34\u3002" : "Word \
|
|
23794
|
+
showToast(hasMetafile ? "\u5DF2\u4ECE Word \u526A\u8D34\u677F\u53D6\u5230 EMF/WMF \u56FE\u7247\uFF0C\u4F46\u683C\u5F0F\u8F6C\u6362\u5931\u8D25\u3002\u8BF7\u91CD\u65B0\u590D\u5236\uFF0C\u6216\u5728 Word \u4E2D\u53F3\u952E\u56FE\u7247\u9009\u62E9\u201C\u590D\u5236\u56FE\u7247\u201D\u540E\u5355\u72EC\u7C98\u8D34\u3002" : "Word \u4E2D\u6309 Ctrl+A \u5168\u9009\u590D\u5236\u65F6\uFF0C\u526A\u8D34\u677F\u53EF\u80FD\u6CA1\u6709\u5305\u542B\u56FE\u7247\u672C\u8EAB\uFF0C\u7F51\u9875\u65E0\u6CD5\u4ECE\u56FE\u7247\u5F15\u7528\u6062\u590D\u539F\u56FE\u3002\u8BF7\u5728 Word \u4E2D\u5355\u72EC\u9009\u4E2D\u56FE\u7247\u5E76\u590D\u5236\u540E\u518D\u7C98\u8D34\uFF0C\u6216\u5C06\u56FE\u7247\u53E6\u5B58\u4E3A\u6587\u4EF6\u63D2\u5165\u3002", 7e3);
|
|
23795
23795
|
}
|
|
23796
23796
|
safe = sanitizeWordHtml(template.innerHTML);
|
|
23797
23797
|
this.runCommand((cmd) => cmd.pasteHtmlFragment(this.editor, safe.html, safe.text));
|
|
@@ -23835,6 +23835,11 @@ var WebAdapter = class {
|
|
|
23835
23835
|
const items = await read.call(navigator.clipboard);
|
|
23836
23836
|
const files = [];
|
|
23837
23837
|
for (const item of items) {
|
|
23838
|
+
const rtfType = item.types.find((type) => /(?:text|application)\/rtf/i.test(type));
|
|
23839
|
+
if (rtfType) {
|
|
23840
|
+
const rtf = await (await item.getType(rtfType)).text();
|
|
23841
|
+
files.push(...extractRtfImageFiles(rtf));
|
|
23842
|
+
}
|
|
23838
23843
|
const imageType = item.types.find((type) => type.startsWith("image/"));
|
|
23839
23844
|
if (!imageType) continue;
|
|
23840
23845
|
const blob = await item.getType(imageType);
|