lengyue-editor 1.2.0-alpha.3 → 1.2.0-alpha.4
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/dist/umo-editor.js +52 -50
- package/package.json +1 -1
package/dist/umo-editor.js
CHANGED
|
@@ -65,7 +65,7 @@ import xi from "nzh/cn";
|
|
|
65
65
|
import zd from "mammoth";
|
|
66
66
|
import { ObjectSchema as p5 } from "@eslint/object-schema";
|
|
67
67
|
/**
|
|
68
|
-
* lengyue-editor 1.2.0-alpha.
|
|
68
|
+
* lengyue-editor 1.2.0-alpha.4
|
|
69
69
|
* @license MIT
|
|
70
70
|
* @author umodoc https://www.umodoc.com
|
|
71
71
|
* @see https://www.umodoc.com
|
|
@@ -44099,7 +44099,7 @@ const rr = /* @__PURE__ */ te({
|
|
|
44099
44099
|
const e = J("container", "body"), n = dn(), r = (a) => n.expose = a;
|
|
44100
44100
|
return (a, o) => (B(), q(OC(yt(k(F1e), { ...a.$attrs, attach: k(e), ref: r }, a.$slots))));
|
|
44101
44101
|
}
|
|
44102
|
-
}), R1e = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='460.224'%20height='128'%3e%3cg%20fill='none'%3e%3cpath%20d='M450.627%2039.41l9.597%2013.658c-2.724%2015.076-5.577%2030.28-8.3%2045.486-4.886%204.594-9.771%209.19-14.654%2013.787h-65.878c-3.113-4.768-6.355-9.406-9.467-14.174%202.723-15.076%205.576-30.023%208.3-45.099l14.524-13.658h65.878zm-240.182-1.057l-8.99%2049.222h41.483l4.238-22.936%2020.678%2017.653-2.826%2015.205-14.512%2013.787h-65.244l-9.375-13.787%2010.66-59.144h23.888zm57.537%200l32.574%2029.302%2045.733-29.302h15.636l-16.027%2072.931h-27.492l7.297-33.34-31.662%2017.712-45.213-38.55%204.17-18.753h14.984zM430.397%2062.99H396.16l-4.539%203.866c-1.037%205.798-2.205%2011.725-3.242%2017.653l3.112%204.252h35.014c1.297-1.289%202.594-2.577%203.632-3.737.291-1.514.575-3.028.855-4.542l1.661-9.084.855-4.542-3.112-3.866h.001zM78.005%200L65.638%2082.444l-48.62%206.342-.846%205.496%2062.256-1.48%2011.31-68.28%2041.75-10.464-15.855%2091.851-32.026%2021.985H0L18.074%2015.432%2078.005%200zM56.971%2064.581l-37.523%209.302-.422%202.854%2037.522-9.302.423-2.854zm2.431-15.009L21.88%2058.874l-.423%202.853%2037.522-9.301.423-2.854zm2.431-15.009L24.31%2043.865l-.422%202.853%2037.522-9.301.423-2.854zm2.431-15.115L26.742%2028.75l-.423%202.854%2037.522-9.302.423-2.854z'%20fill='%234376F8'/%3e%3cpath%20fill-opacity='.7'%20fill='%23FFF'%20d='M115.633%20106.015l-28.855-.106L83.607%20128z'/%3e%3c/g%3e%3cscript/%3e%3c/svg%3e", B1e = "1.2.0-alpha.
|
|
44102
|
+
}), R1e = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='460.224'%20height='128'%3e%3cg%20fill='none'%3e%3cpath%20d='M450.627%2039.41l9.597%2013.658c-2.724%2015.076-5.577%2030.28-8.3%2045.486-4.886%204.594-9.771%209.19-14.654%2013.787h-65.878c-3.113-4.768-6.355-9.406-9.467-14.174%202.723-15.076%205.576-30.023%208.3-45.099l14.524-13.658h65.878zm-240.182-1.057l-8.99%2049.222h41.483l4.238-22.936%2020.678%2017.653-2.826%2015.205-14.512%2013.787h-65.244l-9.375-13.787%2010.66-59.144h23.888zm57.537%200l32.574%2029.302%2045.733-29.302h15.636l-16.027%2072.931h-27.492l7.297-33.34-31.662%2017.712-45.213-38.55%204.17-18.753h14.984zM430.397%2062.99H396.16l-4.539%203.866c-1.037%205.798-2.205%2011.725-3.242%2017.653l3.112%204.252h35.014c1.297-1.289%202.594-2.577%203.632-3.737.291-1.514.575-3.028.855-4.542l1.661-9.084.855-4.542-3.112-3.866h.001zM78.005%200L65.638%2082.444l-48.62%206.342-.846%205.496%2062.256-1.48%2011.31-68.28%2041.75-10.464-15.855%2091.851-32.026%2021.985H0L18.074%2015.432%2078.005%200zM56.971%2064.581l-37.523%209.302-.422%202.854%2037.522-9.302.423-2.854zm2.431-15.009L21.88%2058.874l-.423%202.853%2037.522-9.301.423-2.854zm2.431-15.009L24.31%2043.865l-.422%202.853%2037.522-9.301.423-2.854zm2.431-15.115L26.742%2028.75l-.423%202.854%2037.522-9.302.423-2.854z'%20fill='%234376F8'/%3e%3cpath%20fill-opacity='.7'%20fill='%23FFF'%20d='M115.633%20106.015l-28.855-.106L83.607%20128z'/%3e%3c/g%3e%3cscript/%3e%3c/svg%3e", B1e = "1.2.0-alpha.4", N1e = "https://www.umodoc.com", am = {
|
|
44103
44103
|
version: B1e,
|
|
44104
44104
|
homepage: N1e
|
|
44105
44105
|
}, L1e = () => {
|
|
@@ -58270,31 +58270,32 @@ const pxe = tr.create({
|
|
|
58270
58270
|
}), P$ = /* @__PURE__ */ te({
|
|
58271
58271
|
__name: "import-word",
|
|
58272
58272
|
setup(t) {
|
|
58273
|
-
const e = J("container"), n = J("editor"), a = J("options").value.importWord, o = () => {
|
|
58273
|
+
const e = J("container"), n = J("editor"), a = J("options").value.importWord, o = N(!1), l = () => {
|
|
58274
58274
|
if (!zd) {
|
|
58275
|
-
|
|
58275
|
+
o.value = !1;
|
|
58276
|
+
const s = ba({
|
|
58276
58277
|
attach: e,
|
|
58277
58278
|
theme: "warning",
|
|
58278
58279
|
header: ae("base.importWord.loadScript.title"),
|
|
58279
58280
|
body: ae("base.importWord.loadScript.message"),
|
|
58280
58281
|
onConfirm() {
|
|
58281
|
-
|
|
58282
|
+
s.destroy();
|
|
58282
58283
|
}
|
|
58283
58284
|
});
|
|
58284
58285
|
return;
|
|
58285
58286
|
}
|
|
58286
|
-
const { open:
|
|
58287
|
+
const { open: i, onChange: u } = cm({
|
|
58287
58288
|
accept: ".docx",
|
|
58288
58289
|
reset: !0,
|
|
58289
58290
|
multiple: !1
|
|
58290
58291
|
});
|
|
58291
|
-
|
|
58292
|
-
var
|
|
58293
|
-
const [
|
|
58294
|
-
if (!
|
|
58292
|
+
i(), u(async (s) => {
|
|
58293
|
+
var b, y, g, w;
|
|
58294
|
+
const [c] = Array.from(s != null ? s : []);
|
|
58295
|
+
if (!c)
|
|
58295
58296
|
return;
|
|
58296
|
-
if (
|
|
58297
|
-
At("error", {
|
|
58297
|
+
if (c.size > a.maxSize) {
|
|
58298
|
+
o.value = !1, At("error", {
|
|
58298
58299
|
attach: e,
|
|
58299
58300
|
content: ae("base.importWord.limitSize", {
|
|
58300
58301
|
limitSize: a.maxSize / (1024 * 1024)
|
|
@@ -58302,28 +58303,28 @@ const pxe = tr.create({
|
|
|
58302
58303
|
});
|
|
58303
58304
|
return;
|
|
58304
58305
|
}
|
|
58305
|
-
const
|
|
58306
|
+
const d = await At("loading", {
|
|
58306
58307
|
attach: e,
|
|
58307
58308
|
content: ae("base.importWord.converting"),
|
|
58308
58309
|
duration: 0
|
|
58309
58310
|
});
|
|
58310
|
-
if (a != null && a.useCustomMethod) {
|
|
58311
|
-
const
|
|
58312
|
-
|
|
58311
|
+
if (o.value = !0, a != null && a.useCustomMethod) {
|
|
58312
|
+
const _ = await ((b = a.onCustomImportMethod) == null ? void 0 : b.call(a, c));
|
|
58313
|
+
d.close(), o.value = !1;
|
|
58313
58314
|
try {
|
|
58314
|
-
if (((
|
|
58315
|
-
At("error", {
|
|
58315
|
+
if (((y = _ == null ? void 0 : _.messages) == null ? void 0 : y.type) === "error") {
|
|
58316
|
+
o.value = !1, At("error", {
|
|
58316
58317
|
attach: e,
|
|
58317
|
-
content: `${ae("base.importWord.convertError")} (${
|
|
58318
|
+
content: `${ae("base.importWord.convertError")} (${_.messages.message})`
|
|
58318
58319
|
});
|
|
58319
58320
|
return;
|
|
58320
58321
|
}
|
|
58321
|
-
|
|
58322
|
+
_ != null && _.value ? (g = n.value) == null || g.commands.setContent(_.value) : (o.value = !1, At("error", {
|
|
58322
58323
|
attach: e,
|
|
58323
58324
|
content: ae("base.importWord.importError")
|
|
58324
|
-
});
|
|
58325
|
-
} catch (
|
|
58326
|
-
At("error", {
|
|
58325
|
+
}));
|
|
58326
|
+
} catch (C) {
|
|
58327
|
+
o.value = !1, At("error", {
|
|
58327
58328
|
attach: e,
|
|
58328
58329
|
content: ae("base.importWord.importError")
|
|
58329
58330
|
});
|
|
@@ -58332,13 +58333,13 @@ const pxe = tr.create({
|
|
|
58332
58333
|
}
|
|
58333
58334
|
if (!zd)
|
|
58334
58335
|
return;
|
|
58335
|
-
const
|
|
58336
|
-
transformConvertRun(
|
|
58337
|
-
const
|
|
58338
|
-
return
|
|
58339
|
-
style: `background-color:${
|
|
58340
|
-
"data-color":
|
|
58341
|
-
}),
|
|
58336
|
+
const v = c.arrayBuffer(), f = {
|
|
58337
|
+
transformConvertRun(_) {
|
|
58338
|
+
const C = {};
|
|
58339
|
+
return _.bgColor && (C.mark = {
|
|
58340
|
+
style: `background-color:${_.bgColor}; color: inherit`,
|
|
58341
|
+
"data-color": _.bgColor
|
|
58342
|
+
}), C;
|
|
58342
58343
|
},
|
|
58343
58344
|
styleMap: [
|
|
58344
58345
|
"p[style-name='引用'] => blockquote.blockquote > p:fresh",
|
|
@@ -58348,44 +58349,45 @@ const pxe = tr.create({
|
|
|
58348
58349
|
"p[style-name='Code'] => pre.preCode > code:fresh",
|
|
58349
58350
|
"p[style-name='code'] => pre.preCode > code:fresh"
|
|
58350
58351
|
]
|
|
58351
|
-
}, { messages:
|
|
58352
|
-
{ arrayBuffer:
|
|
58352
|
+
}, { messages: m, value: p } = await zd.convertToHtml(
|
|
58353
|
+
{ arrayBuffer: v },
|
|
58353
58354
|
{
|
|
58354
|
-
...
|
|
58355
|
+
...f,
|
|
58355
58356
|
...a.options
|
|
58356
58357
|
}
|
|
58357
58358
|
);
|
|
58358
|
-
if (
|
|
58359
|
-
At(
|
|
58359
|
+
if (m.type === "error") {
|
|
58360
|
+
o.value = !1, At(
|
|
58360
58361
|
"error",
|
|
58361
|
-
`${ae("base.importWord.convertError")} (${
|
|
58362
|
+
`${ae("base.importWord.convertError")} (${m.message})`
|
|
58362
58363
|
);
|
|
58363
58364
|
return;
|
|
58364
58365
|
}
|
|
58365
58366
|
try {
|
|
58366
|
-
const
|
|
58367
|
-
for (const
|
|
58368
|
-
const
|
|
58369
|
-
(
|
|
58367
|
+
const C = new DOMParser().parseFromString(p, "text/html");
|
|
58368
|
+
for (const O of C.querySelectorAll("img")) {
|
|
58369
|
+
const P = O.parentElement;
|
|
58370
|
+
(P == null ? void 0 : P.tagName) === "P" && (P.insertAdjacentElement("beforebegin", O), !P.hasChildNodes() && P.textContent === "" && P.remove());
|
|
58370
58371
|
}
|
|
58371
|
-
const
|
|
58372
|
-
(
|
|
58373
|
-
} catch (
|
|
58374
|
-
At("error", {
|
|
58372
|
+
const x = C.body.innerHTML.toString();
|
|
58373
|
+
(w = n.value) == null || w.commands.setContent(x), console.log("word导入已经渲染完成"), d.close(), o.value = !1;
|
|
58374
|
+
} catch (_) {
|
|
58375
|
+
o.value = !1, At("error", {
|
|
58375
58376
|
attach: e,
|
|
58376
58377
|
content: ae("base.importWord.importError")
|
|
58377
58378
|
});
|
|
58378
58379
|
}
|
|
58379
58380
|
});
|
|
58380
58381
|
};
|
|
58381
|
-
return (
|
|
58382
|
-
const
|
|
58383
|
-
return B(), q(
|
|
58382
|
+
return (i, u) => {
|
|
58383
|
+
const s = Ce;
|
|
58384
|
+
return B(), q(s, {
|
|
58384
58385
|
ico: "word",
|
|
58385
|
-
text:
|
|
58386
|
+
text: i.t("base.importWord.text"),
|
|
58386
58387
|
huge: "",
|
|
58387
|
-
onMenuClick:
|
|
58388
|
-
|
|
58388
|
+
onMenuClick: l,
|
|
58389
|
+
disabled: k(o)
|
|
58390
|
+
}, null, 8, ["text", "disabled"]);
|
|
58389
58391
|
};
|
|
58390
58392
|
}
|
|
58391
58393
|
}), E$ = /* @__PURE__ */ te({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lengyue-editor",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Umo Editor is open-source document editor based on Vue3 and Tiptap. Umo Editor provides comprehensive document editing capabilities and AI creation features, supports pagination, supports Markdown syntax, offers basic rich text editing functions, allows for the insertion of various node types in multiple formats, provides a variety of practical tools, and supports setting page styles. It also supports exporting in various formats, printing and print preview, block-level document editing, adding custom extensions, multi-language settings, and a dark theme.",
|
|
6
6
|
"keywords": [
|