@mce/bigesj 0.2.5 → 0.2.6
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/index.js +141 -142
- package/dist/loaders/bige.d.ts +1 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5,30 +5,30 @@ import { idGenerator as U, normalizeCRLF as Mt, isGradient as dt } from "modern-
|
|
|
5
5
|
import { gunzipSync as Lt } from "fflate";
|
|
6
6
|
const X = Z([]);
|
|
7
7
|
function wt(e, r) {
|
|
8
|
-
const
|
|
8
|
+
const i = [];
|
|
9
9
|
for (let t = 0; t <= r.length; t++)
|
|
10
|
-
|
|
10
|
+
i[t] = [t];
|
|
11
11
|
for (let t = 0; t <= e.length; t++)
|
|
12
|
-
|
|
12
|
+
i[0][t] = t;
|
|
13
13
|
for (let t = 1; t <= r.length; t++)
|
|
14
14
|
for (let s = 1; s <= e.length; s++) {
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const o = e[s - 1] === r[t - 1] ? 0 : 1;
|
|
16
|
+
i[t][s] = Math.min(i[t - 1][s] + 1, i[t][s - 1] + 1, i[t - 1][s - 1] + o);
|
|
17
17
|
}
|
|
18
|
-
return
|
|
18
|
+
return i[r.length][e.length];
|
|
19
19
|
}
|
|
20
20
|
function mt() {
|
|
21
21
|
const {
|
|
22
22
|
loadFont: e
|
|
23
23
|
} = rt(), r = Z(/* @__PURE__ */ new Map());
|
|
24
|
-
async function o
|
|
25
|
-
let
|
|
26
|
-
return
|
|
24
|
+
async function i(o) {
|
|
25
|
+
let n = X.value;
|
|
26
|
+
return n.length || (n = await fetch(o).then((f) => f.json()).then((f) => f.data.datalist), X.value = n), n;
|
|
27
27
|
}
|
|
28
|
-
function t(
|
|
29
|
-
const f = new Map(
|
|
30
|
-
|
|
31
|
-
), d =
|
|
28
|
+
function t(o, n = X.value) {
|
|
29
|
+
const f = new Map(n.map((a, l) => [a.id, l])), M = new Map(
|
|
30
|
+
n.flatMap((a, l) => [...a.en_name.split(","), ...a.name.split(",")].map((L) => [L, l]))
|
|
31
|
+
), d = o.replace(/"/g, "").split(",");
|
|
32
32
|
let c;
|
|
33
33
|
if (d.forEach((a) => {
|
|
34
34
|
c ??= f.get(a), c ??= M.get(a);
|
|
@@ -47,11 +47,11 @@ function mt() {
|
|
|
47
47
|
});
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
return c !== void 0 ?
|
|
50
|
+
return c !== void 0 ? n[c] : void 0;
|
|
51
51
|
}
|
|
52
|
-
async function s(
|
|
53
|
-
const
|
|
54
|
-
for (const M of
|
|
52
|
+
async function s(o) {
|
|
53
|
+
const n = typeof o == "string" ? [o] : o, f = [];
|
|
54
|
+
for (const M of n) {
|
|
55
55
|
let d = r.value.get(M);
|
|
56
56
|
if (!d) {
|
|
57
57
|
const c = t(M);
|
|
@@ -74,7 +74,7 @@ function mt() {
|
|
|
74
74
|
return {
|
|
75
75
|
bigeFonts: X,
|
|
76
76
|
searchBigeFont: t,
|
|
77
|
-
loadBigeFonts:
|
|
77
|
+
loadBigeFonts: i,
|
|
78
78
|
loadFont: s
|
|
79
79
|
};
|
|
80
80
|
}
|
|
@@ -86,23 +86,23 @@ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
|
86
86
|
// @__NO_SIDE_EFFECTS__
|
|
87
87
|
function yt(e) {
|
|
88
88
|
if (!gt) return e;
|
|
89
|
-
let r = 0,
|
|
89
|
+
let r = 0, i, t;
|
|
90
90
|
const s = () => {
|
|
91
|
-
r -= 1, t && r <= 0 && (t.stop(),
|
|
91
|
+
r -= 1, t && r <= 0 && (t.stop(), i = void 0, t = void 0);
|
|
92
92
|
};
|
|
93
|
-
return ((...
|
|
93
|
+
return ((...o) => (r += 1, t || (t = it(!0), i = t.run(() => e(...o))), ut(s), i));
|
|
94
94
|
}
|
|
95
95
|
const _ = /* @__PURE__ */ yt(() => {
|
|
96
96
|
const e = /* @__PURE__ */ new Map();
|
|
97
97
|
function r(t, s) {
|
|
98
|
-
let
|
|
99
|
-
return
|
|
98
|
+
let o = e.get(t);
|
|
99
|
+
return o || (o = fetch(t).then(s), e.set(t, o)), o;
|
|
100
100
|
}
|
|
101
|
-
async function
|
|
101
|
+
async function i(t) {
|
|
102
102
|
return r(t, (s) => s.text());
|
|
103
103
|
}
|
|
104
104
|
return {
|
|
105
|
-
fetchToText:
|
|
105
|
+
fetchToText: i
|
|
106
106
|
};
|
|
107
107
|
}), Y = {
|
|
108
108
|
easing: {
|
|
@@ -437,12 +437,12 @@ const _ = /* @__PURE__ */ yt(() => {
|
|
|
437
437
|
]
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
|
-
function G(e, r,
|
|
440
|
+
function G(e, r, i) {
|
|
441
441
|
const {
|
|
442
442
|
name: t,
|
|
443
443
|
delay: s = 0,
|
|
444
|
-
duration:
|
|
445
|
-
iterations:
|
|
444
|
+
duration: o,
|
|
445
|
+
iterations: n,
|
|
446
446
|
mode: f,
|
|
447
447
|
easing: M,
|
|
448
448
|
path: d,
|
|
@@ -457,7 +457,7 @@ function G(e, r, o) {
|
|
|
457
457
|
L += ` ${m[0]}${y[m[0]].join(" ")}`;
|
|
458
458
|
});
|
|
459
459
|
const w = `path("${L}")`;
|
|
460
|
-
switch (
|
|
460
|
+
switch (i) {
|
|
461
461
|
case "in":
|
|
462
462
|
l = [
|
|
463
463
|
{ opacity: 0, offsetDistance: "100%", offsetPath: w, offsetRotate: c },
|
|
@@ -478,7 +478,7 @@ function G(e, r, o) {
|
|
|
478
478
|
break;
|
|
479
479
|
}
|
|
480
480
|
} else
|
|
481
|
-
switch (
|
|
481
|
+
switch (i) {
|
|
482
482
|
case "in":
|
|
483
483
|
l = Y.textIn[t]?.[0] ?? Y.in[t];
|
|
484
484
|
break;
|
|
@@ -493,7 +493,7 @@ function G(e, r, o) {
|
|
|
493
493
|
id: U(),
|
|
494
494
|
name: r.name ?? r.title ?? r.id,
|
|
495
495
|
delay: s,
|
|
496
|
-
duration: t ?
|
|
496
|
+
duration: t ? o * (n || 1) : 0,
|
|
497
497
|
effectMode: f === "逐字" || f === "逐行" ? "sibling" : "parent",
|
|
498
498
|
keyframes: l ?? [],
|
|
499
499
|
easing: Y.easing[M],
|
|
@@ -512,38 +512,38 @@ function jt(e) {
|
|
|
512
512
|
duration: 0,
|
|
513
513
|
animations: []
|
|
514
514
|
};
|
|
515
|
-
let r,
|
|
516
|
-
e.animations[0].in ? (r = e.animations[0].in,
|
|
517
|
-
const s = r?.delay ?? 0,
|
|
518
|
-
return r &&
|
|
515
|
+
let r, i, t;
|
|
516
|
+
e.animations[0].in ? (r = e.animations[0].in, i = e.animations[0].stay, t = e.animations[0].out) : (r = e.animations?.find((f) => f.category === "in"), i = e.animations?.find((f) => f.category === "stay"), t = e.animations?.find((f) => f.category === "out"));
|
|
517
|
+
const s = r?.delay ?? 0, o = t ? t.delay - s + t.duration : 0, n = [];
|
|
518
|
+
return r && n.push(
|
|
519
519
|
G(e, {
|
|
520
520
|
...r,
|
|
521
521
|
delay: 0
|
|
522
522
|
}, "in")
|
|
523
|
-
),
|
|
523
|
+
), i && n.push(
|
|
524
524
|
G(e, {
|
|
525
|
-
...
|
|
526
|
-
delay:
|
|
525
|
+
...i,
|
|
526
|
+
delay: i.delay - s
|
|
527
527
|
}, "stay")
|
|
528
|
-
), t &&
|
|
528
|
+
), t && n.push(
|
|
529
529
|
G(e, {
|
|
530
530
|
...t,
|
|
531
531
|
delay: t.delay - s
|
|
532
532
|
}, "out")
|
|
533
533
|
), {
|
|
534
534
|
delay: s,
|
|
535
|
-
duration:
|
|
536
|
-
animations:
|
|
535
|
+
duration: o - s,
|
|
536
|
+
animations: n.filter((f) => !!f?.keyframes)
|
|
537
537
|
};
|
|
538
538
|
}
|
|
539
539
|
async function V(e) {
|
|
540
540
|
const {
|
|
541
541
|
transform: r = {},
|
|
542
|
-
style:
|
|
542
|
+
style: i = {},
|
|
543
543
|
maskUrl: t,
|
|
544
544
|
imageEffects: s = [],
|
|
545
|
-
imageEffectsRatio:
|
|
546
|
-
} = e,
|
|
545
|
+
imageEffectsRatio: o = 1
|
|
546
|
+
} = e, n = e.clipUrl || e.url, {
|
|
547
547
|
translateX: f = 0,
|
|
548
548
|
translateY: M = 0,
|
|
549
549
|
zoom: d = 1
|
|
@@ -551,10 +551,10 @@ async function V(e) {
|
|
|
551
551
|
scaleX: c = 1,
|
|
552
552
|
scaleY: a = 1,
|
|
553
553
|
filter: l
|
|
554
|
-
} =
|
|
554
|
+
} = i;
|
|
555
555
|
if (f === 0 && M === 0 && d === 1 && c === 1 && a === 1 && !t && !l && !s.length)
|
|
556
|
-
return
|
|
557
|
-
const L = await B.fetchImageBitmap(
|
|
556
|
+
return n;
|
|
557
|
+
const L = await B.fetchImageBitmap(n), {
|
|
558
558
|
originWidth: w = L.width,
|
|
559
559
|
originHeight: y = L.height,
|
|
560
560
|
imageWidth: m = w,
|
|
@@ -562,7 +562,7 @@ async function V(e) {
|
|
|
562
562
|
} = r, {
|
|
563
563
|
width: j = w,
|
|
564
564
|
height: h = y
|
|
565
|
-
} =
|
|
565
|
+
} = i, D = window.devicePixelRatio || 1, [g, u] = W(j, h, D);
|
|
566
566
|
if (l && (u.filter = l), u.scale(c, a), u.translate(c < 0 ? -j : 0, a < 0 ? -h : 0), t) {
|
|
567
567
|
const T = await B.fetchImageBitmap(t);
|
|
568
568
|
u.drawImage(T, 0, 0, T.width, T.height, 0, 0, j, h), T.close(), u.globalCompositeOperation = "source-in";
|
|
@@ -601,11 +601,11 @@ async function V(e) {
|
|
|
601
601
|
}), p.stroke();
|
|
602
602
|
}).make(z, {
|
|
603
603
|
color: x,
|
|
604
|
-
thickness: I / 50 *
|
|
604
|
+
thickness: I / 50 * o
|
|
605
605
|
});
|
|
606
606
|
}), R) {
|
|
607
607
|
let { x: I, y: x } = R;
|
|
608
|
-
I = I / 50 *
|
|
608
|
+
I = I / 50 * o * 200, x = x / 50 * o * 200, u.drawImage(z, I + S.x, x + S.y, j, h);
|
|
609
609
|
} else
|
|
610
610
|
u.drawImage(z, S.x, S.y, j, h);
|
|
611
611
|
}
|
|
@@ -616,16 +616,16 @@ async function V(e) {
|
|
|
616
616
|
try {
|
|
617
617
|
T(URL.createObjectURL(S));
|
|
618
618
|
} catch (v) {
|
|
619
|
-
console.error(`Failed to URL.createObjectURL, url: ${
|
|
619
|
+
console.error(`Failed to URL.createObjectURL, url: ${n}`, v), T(n);
|
|
620
620
|
}
|
|
621
621
|
});
|
|
622
622
|
});
|
|
623
623
|
}
|
|
624
|
-
function W(e, r,
|
|
624
|
+
function W(e, r, i = 1) {
|
|
625
625
|
const t = document.createElement("canvas");
|
|
626
|
-
t.width = e *
|
|
626
|
+
t.width = e * i, t.height = r * i, t.style.width = `${e}px`, t.style.height = `${r}px`;
|
|
627
627
|
const s = t.getContext("2d");
|
|
628
|
-
return s.scale(
|
|
628
|
+
return s.scale(i, i), [t, s];
|
|
629
629
|
}
|
|
630
630
|
class ht {
|
|
631
631
|
canvas = document.createElement("canvas");
|
|
@@ -633,14 +633,14 @@ class ht {
|
|
|
633
633
|
use(r) {
|
|
634
634
|
return this.method = r, this;
|
|
635
635
|
}
|
|
636
|
-
make(r,
|
|
637
|
-
const { canvas: t } = this, s = this.canvas.getContext("2d"),
|
|
638
|
-
return (
|
|
636
|
+
make(r, i) {
|
|
637
|
+
const { canvas: t } = this, s = this.canvas.getContext("2d"), o = i.thickness * 2, [n, f] = [r.width, r.height].map((M) => M + o);
|
|
638
|
+
return (n !== t.width || f !== t.height) && (t.width = n, t.height = f), s.clearRect(0, 0, s.canvas.width, s.canvas.height), this.method(s, r, i), s.drawImage(r, i.thickness, i.thickness), t;
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
641
|
function Ct(e) {
|
|
642
|
-
const t = e.canvas.width, s = e.canvas.height,
|
|
643
|
-
let
|
|
642
|
+
const t = e.canvas.width, s = e.canvas.height, o = [];
|
|
643
|
+
let n = 3;
|
|
644
644
|
const f = 100;
|
|
645
645
|
return (() => {
|
|
646
646
|
const d = [], c = new Uint32Array(e.getImageData(0, 0, t, s).data.buffer);
|
|
@@ -653,9 +653,9 @@ function Ct(e) {
|
|
|
653
653
|
let A = 0;
|
|
654
654
|
return h(g - 1, u - 1) && (A += 1), h(g, u - 1) && (A += 2), h(g - 1, u) && (A += 4), h(g, u) && (A += 8), A === 6 ? C === 0 ? 2 : 3 : A === 9 ? C === 3 ? 0 : 1 : j[A];
|
|
655
655
|
}
|
|
656
|
-
for (let g =
|
|
656
|
+
for (let g = n; g < c.length; g++)
|
|
657
657
|
if (c[g] >>> 24 > f) {
|
|
658
|
-
y =
|
|
658
|
+
y = n = g;
|
|
659
659
|
break;
|
|
660
660
|
}
|
|
661
661
|
if (y >= 0) {
|
|
@@ -664,30 +664,30 @@ function Ct(e) {
|
|
|
664
664
|
m = D(a, l), m === 0 ? l-- : m === 1 ? l++ : m === 2 ? a-- : m === 3 && a++, m !== C && (d.push({ x: a + 0, y: l + 0 }), C = m);
|
|
665
665
|
while (a !== L || l !== w);
|
|
666
666
|
}
|
|
667
|
-
return
|
|
668
|
-
})(),
|
|
667
|
+
return o.push(d), d;
|
|
668
|
+
})(), o;
|
|
669
669
|
}
|
|
670
670
|
async function pt(e) {
|
|
671
671
|
const {
|
|
672
672
|
id: r,
|
|
673
|
-
doc:
|
|
673
|
+
doc: i,
|
|
674
674
|
url: t,
|
|
675
675
|
style: s = {},
|
|
676
|
-
background:
|
|
676
|
+
background: o = {}
|
|
677
677
|
} = e;
|
|
678
|
-
let
|
|
679
|
-
|
|
678
|
+
let n = i;
|
|
679
|
+
n || (n = await fetch(t).then((M) => M.text()));
|
|
680
680
|
const f = new DOMParser().parseFromString(
|
|
681
|
-
|
|
681
|
+
n.replace(new RegExp(`#el-${r} `, "gi"), "").replace(/data-colors\s/, " ").replace(/[a-z-]+="([^\s<]*<\S*)"/gi, ""),
|
|
682
682
|
"image/svg+xml"
|
|
683
683
|
).documentElement;
|
|
684
684
|
if (!(f instanceof SVGElement))
|
|
685
|
-
throw new TypeError(`Failed to DOMParser, parse svg to DOM error: ${
|
|
686
|
-
if (
|
|
685
|
+
throw new TypeError(`Failed to DOMParser, parse svg to DOM error: ${n}`);
|
|
686
|
+
if (o.src) {
|
|
687
687
|
const M = `#${r}-fill-blip`, d = f.querySelector(M), c = d?.querySelector("image");
|
|
688
688
|
if (d && c)
|
|
689
689
|
try {
|
|
690
|
-
const a = await B.fetchImageBitmap(
|
|
690
|
+
const a = await B.fetchImageBitmap(o.src).then((l) => {
|
|
691
691
|
const L = document.createElement("canvas");
|
|
692
692
|
return L.width = l.width, L.height = l.height, L.getContext("2d")?.drawImage(l, 0, 0), l.close(), L.toDataURL("image/png");
|
|
693
693
|
});
|
|
@@ -708,21 +708,21 @@ async function pt(e) {
|
|
|
708
708
|
}
|
|
709
709
|
const At = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgNzIgNzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDcyIDcyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxnPgoJPHBhdGggZD0iTTE5LjMsMzguMWMwLjIsMC41LDAuNCwwLjksMC43LDEuNGMwLjIsMC4zLDAuNCwwLjQsMC44LDAuNGMwLjMsMCwwLjUtMC4xLDAuNi0wLjRjMC4xLTAuMywwLjEtMC42LDAuMi0wLjkgICBjMC0wLjIsMC4xLTAuNCwwLjMtMC41YzAuMi0wLjEsMC40LTAuMiwwLjYtMC4xYzAuMiwwLDAuNCwwLjEsMC41LDAuM2MwLjEsMC4yLDAuMiwwLjQsMC4xLDAuNmMtMC4xLDAuNi0wLjIsMS4yLTAuNCwxLjcgICBjLTAuMywwLjgtM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IsMC0wLjQtMC4xLTAuNi0wLjJjLTAuMS0wLjItMC4yLTAuNC0wLjItMC42bDAtMS42YzAtMC4yLDAuMS0wLjQsMC4yLTAuNmMwLjItMC4yLDAuMy0wLjIsMC42LTAuMiAgIHMwLjQsMC4xLDAuNiwwLjJjMC4yLDAuMiwwLjIsMC40LDAuMiwwLjZWNDAuN3ogTTUyLjgsNDAuN2MwLDAuMi0wLjEsMC40LTAuMiwwLjZjLTAuMiwwLjEtMC40LDAuMi0wLjYsMC4yICAgYy0wLjIsMC0wLjQtMC4xLTAuNi0wLjJjLTAuMi0wLjEtMC4yLTAuMy0wLjItMC42bDAtMS42YzAtMC4yLDAuMS0wLjQsMC4yLTAuNmMwLjItMC4yLDAuMy0wLjIsMC42LTAuMmMwLjIsMCwwLjQsMC4xLDAuNiwwLjIgICBjMC4yLDAuMiwwLjIsMC40LDAuMiwwLjZWNDAuN3ogTTU2LjYsNDAuM2MwLjIsMC40LDAuMSwwLjgtMC4zLDEuMWMtMC41LDAuMy0wLjgsMC4yLTEuMS0wLjNsLTEtMS43Yy0wLjItMC41LTAuMS0wLjgsMC4zLTEuMSAgIGMwLjUtMC4yLDAuOS0wLjEsMS4xLDAuM0w1Ni42LDQwLjN6Ii8+CjwvZz4KPC9zdmc+";
|
|
710
710
|
async function xt(e, r = !1) {
|
|
711
|
-
const { fetchToText:
|
|
711
|
+
const { fetchToText: i } = _(), t = {
|
|
712
712
|
...e.style,
|
|
713
713
|
highlightReferImage: At,
|
|
714
714
|
listStyleType: "none",
|
|
715
715
|
listStyleImage: "none"
|
|
716
716
|
};
|
|
717
|
-
return e.style.fontSize && (t.fontSize = Math.floor(e.style.fontSize)), e.listStyle?.colormap && (t.listStyleColormap = e.listStyle?.colormap), r || (e.listMode ? t.listStyleType = "disc" : e.listStyle && (t.listStyleImage = await
|
|
717
|
+
return e.style.fontSize && (t.fontSize = Math.floor(e.style.fontSize)), e.listStyle?.colormap && (t.listStyleColormap = e.listStyle?.colormap), r || (e.listMode ? t.listStyleType = "disc" : e.listStyle && (t.listStyleImage = await i(e.listStyle.image), t.listStyleSize = `${e.listStyle.size * 100}%`)), e.background?.enabled ? (t.backgroundImage = e.background.image, t.backgroundSize = e.background.size, t.backgroundColormap = e.background.colormap, t.padding = e.background.padding) : t.padding = 0, t;
|
|
718
718
|
}
|
|
719
719
|
async function Tt(e) {
|
|
720
720
|
const r = e.textEffects ?? [];
|
|
721
721
|
if (r.length)
|
|
722
722
|
return await Promise.all(
|
|
723
|
-
[...r].reverse().map(async (
|
|
724
|
-
const t = {}, { offset: s, skew:
|
|
725
|
-
if (s && (t.translateX = s.x, t.translateY = s.y),
|
|
723
|
+
[...r].reverse().map(async (i) => {
|
|
724
|
+
const t = {}, { offset: s, skew: o, stroke: n, shadow: f, filling: M } = i;
|
|
725
|
+
if (s && (t.translateX = s.x, t.translateY = s.y), o && (t.skewX = o.x, t.skewY = o.y), n?.color && n.width && (t.textStrokeWidth = n.width, t.textStrokeColor = n.color), f && (t.shadowOffsetX = f.offsetX, t.shadowOffsetY = f.offsetY, t.shadowBlur = f.blur, t.shadowColor = f.color), M) {
|
|
726
726
|
const { color: d, imageContent: c, gradient: a } = M;
|
|
727
727
|
c?.image || (a ? t.color = `linear-gradient(${90 - a.angle}deg, ${a.stops.map((l) => `${l.color} ${l.offset * 100}%`).join(",")})` : d && (t.color = d));
|
|
728
728
|
}
|
|
@@ -732,25 +732,25 @@ async function Tt(e) {
|
|
|
732
732
|
}
|
|
733
733
|
function Dt(e) {
|
|
734
734
|
return e.version ? e.contents : e.contents.map((r) => {
|
|
735
|
-
let
|
|
735
|
+
let i;
|
|
736
736
|
return r.map((t, s) => {
|
|
737
|
-
let
|
|
738
|
-
|
|
737
|
+
let o = t.content;
|
|
738
|
+
o = o.replace(/ |\r\n|\n\r|[\n\r\t\v]/g, " "), o = o.replace(/<br\/>/g, `
|
|
739
739
|
`);
|
|
740
|
-
let
|
|
741
|
-
for (const M of Array.from(
|
|
742
|
-
s === 0 && f === 0 && M === " " ||
|
|
740
|
+
let n = "", f = 0;
|
|
741
|
+
for (const M of Array.from(o))
|
|
742
|
+
s === 0 && f === 0 && M === " " || i === " " && M === " " || (n += M), i = M, f++;
|
|
743
743
|
return {
|
|
744
744
|
...t,
|
|
745
|
-
content:
|
|
745
|
+
content: n
|
|
746
746
|
};
|
|
747
747
|
}).filter((t) => t.content);
|
|
748
748
|
});
|
|
749
749
|
}
|
|
750
750
|
async function It(e, r = !1) {
|
|
751
|
-
const { fetchToText:
|
|
752
|
-
for (let
|
|
753
|
-
const f = t[
|
|
751
|
+
const { fetchToText: i } = _(), t = Dt(e), s = [];
|
|
752
|
+
for (let o = 0, n = t.length; o < n; o++) {
|
|
753
|
+
const f = t[o], M = {
|
|
754
754
|
fragments: []
|
|
755
755
|
};
|
|
756
756
|
s.push(M);
|
|
@@ -758,7 +758,7 @@ async function It(e, r = !1) {
|
|
|
758
758
|
const a = {}, l = f[d];
|
|
759
759
|
for (const w in l)
|
|
760
760
|
w !== "id" && l[w] !== "" && (a[w] = l[w]);
|
|
761
|
-
a.fontSize && (a.fontSize = Math.floor(a.fontSize)), a.content = Mt(a.content), a.highlight && (a.highlightImage = await
|
|
761
|
+
a.fontSize && (a.fontSize = Math.floor(a.fontSize)), a.content = Mt(a.content), a.highlight && (a.highlightImage = await i(a.highlight.image), r ? a.highlightSize = "cover" : a.highlight.size && (a.highlightSize = `${a.highlight.size}rem`), a.highlight.colormap && (a.highlightColormap = a.highlight.colormap), a.highlight.line && (a.highlightLine = a.highlight.line), a.highlight.thickness && (a.highlightThickness = `${a.highlight.thickness}%`), delete a.highlight), r || (a.listMode ? M.listStyleType = "disc" : a.listStyle && (M.listStyleImage = await i(a.listStyle.image), M.listStyleSize = `${a.listStyle.size * 100}%`));
|
|
762
762
|
const L = M.fragments[M.fragments.length - 1];
|
|
763
763
|
L && Object.keys(L).length === 1 && L.content && Object.keys(a).length === 1 && a.content ? L.content += a.content : M.fragments.push(a);
|
|
764
764
|
}
|
|
@@ -766,11 +766,11 @@ async function It(e, r = !1) {
|
|
|
766
766
|
return s;
|
|
767
767
|
}
|
|
768
768
|
const P = (e) => (Number.parseFloat(e) || 0) / 100;
|
|
769
|
-
async function q(e, r,
|
|
769
|
+
async function q(e, r, i) {
|
|
770
770
|
const t = { ...e.style ?? e }, s = {
|
|
771
771
|
inPptIs: "Shape",
|
|
772
772
|
inEditorIs: "Element"
|
|
773
|
-
},
|
|
773
|
+
}, o = {
|
|
774
774
|
id: U(),
|
|
775
775
|
name: e.name ?? e.title ?? e.id,
|
|
776
776
|
style: t,
|
|
@@ -778,30 +778,30 @@ async function q(e, r, o) {
|
|
|
778
778
|
children: []
|
|
779
779
|
};
|
|
780
780
|
if (t.borderRadius && (t.borderRadius = t.borderRadius * 0.01 * Math.max(t.height, t.width)), r && e.groupStyle && (t.width = r.style.width * P(e.groupStyle.width), t.height = r.style.height * P(e.groupStyle.height), t.left = r.style.width * P(e.groupStyle.left), t.top = r.style.height * P(e.groupStyle.top)), e.editable === !1 && (t.visibility = "hidden"), e.lock === !0 && (s.lock = !0), e.animations?.length) {
|
|
781
|
-
const
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
781
|
+
const n = jt(e);
|
|
782
|
+
o.delay = n.delay, o.duration = n.duration, o.children.push(...n.animations), i && (n.animations.forEach((f) => {
|
|
783
|
+
i.endTime = Math.max(
|
|
784
|
+
i.endTime,
|
|
785
|
+
n.delay + f.delay + f.duration
|
|
786
786
|
);
|
|
787
|
-
}),
|
|
787
|
+
}), i.endTime = Math.max(i.endTime, n.delay + n.duration));
|
|
788
788
|
}
|
|
789
789
|
switch (e.type) {
|
|
790
790
|
case "image":
|
|
791
|
-
if (s.inPptIs = "Picture",
|
|
791
|
+
if (s.inPptIs = "Picture", o.foreground = {
|
|
792
792
|
image: await V(e),
|
|
793
793
|
fillWithShape: !0
|
|
794
794
|
}, e.clipUrl && (s.rawForegroundImage = e.url), e.cropping) {
|
|
795
|
-
const
|
|
795
|
+
const n = e.style.width, f = e.style.height, {
|
|
796
796
|
imageWidth: M,
|
|
797
797
|
imageHeight: d,
|
|
798
|
-
maskWidth: c =
|
|
798
|
+
maskWidth: c = n,
|
|
799
799
|
maskHeight: a = f,
|
|
800
800
|
translateX: l,
|
|
801
801
|
translateY: L,
|
|
802
802
|
zoom: w = 1
|
|
803
|
-
} = e.cropping, y = M * w, m = d * w, C = (y - c) / 2 - l, j = (m - a) / 2 - L, h = C + c / 2, D = j + a / 2, g = -(
|
|
804
|
-
|
|
803
|
+
} = e.cropping, y = M * w, m = d * w, C = (y - c) / 2 - l, j = (m - a) / 2 - L, h = C + c / 2, D = j + a / 2, g = -(n / 2 - h), u = -(f / 2 - D), A = y - (g + n), k = m - (u + f);
|
|
804
|
+
o.foreground.cropRect = {
|
|
805
805
|
left: g / y,
|
|
806
806
|
top: u / m,
|
|
807
807
|
right: A / y,
|
|
@@ -810,14 +810,14 @@ async function q(e, r, o) {
|
|
|
810
810
|
}
|
|
811
811
|
break;
|
|
812
812
|
case "svg": {
|
|
813
|
-
s.inPptIs = "Picture",
|
|
813
|
+
s.inPptIs = "Picture", o.foreground = {
|
|
814
814
|
image: await pt(e),
|
|
815
815
|
fillWithShape: !0
|
|
816
816
|
};
|
|
817
817
|
break;
|
|
818
818
|
}
|
|
819
819
|
case "text": {
|
|
820
|
-
s.inPptIs = "Shape", t.writingMode === "horizontal-tb" ? t.width = Math.ceil(t.width + t.letterSpacing) : t.height = Math.ceil(t.height + t.letterSpacing),
|
|
820
|
+
s.inPptIs = "Shape", t.writingMode === "horizontal-tb" ? t.width = Math.ceil(t.width + t.letterSpacing) : t.height = Math.ceil(t.height + t.letterSpacing), o.text = {
|
|
821
821
|
content: await It(e),
|
|
822
822
|
style: await xt(e),
|
|
823
823
|
effects: await Tt(e),
|
|
@@ -827,10 +827,10 @@ async function q(e, r, o) {
|
|
|
827
827
|
break;
|
|
828
828
|
}
|
|
829
829
|
case "com":
|
|
830
|
-
s.inPptIs = "GroupShape",
|
|
831
|
-
e.children.map(async (
|
|
830
|
+
s.inPptIs = "GroupShape", o.children = (await Promise.all(
|
|
831
|
+
e.children.map(async (n) => {
|
|
832
832
|
try {
|
|
833
|
-
return await q(
|
|
833
|
+
return await q(n, e, i);
|
|
834
834
|
} catch (f) {
|
|
835
835
|
console.warn(f);
|
|
836
836
|
return;
|
|
@@ -863,24 +863,24 @@ async function q(e, r, o) {
|
|
|
863
863
|
console.warn(e);
|
|
864
864
|
break;
|
|
865
865
|
}
|
|
866
|
-
return
|
|
866
|
+
return o;
|
|
867
867
|
}
|
|
868
|
-
async function St(e, r = !0,
|
|
868
|
+
async function St(e, r = !0, i) {
|
|
869
869
|
const t = U(), s = {
|
|
870
870
|
...e.style ?? e
|
|
871
871
|
};
|
|
872
872
|
r && (s.overflow = "hidden");
|
|
873
|
-
let
|
|
874
|
-
return e.background && (e.background.color && (
|
|
873
|
+
let o;
|
|
874
|
+
return e.background && (e.background.color && (o ??= {}, dt(e.background.color ?? "") ? o.image = e.background.color : o.color = e.background.color), e.background.image && (o ??= {}, o.image = e.background.image)), {
|
|
875
875
|
id: t,
|
|
876
876
|
name: r ? `Frame ${t}` : e.name,
|
|
877
877
|
style: s,
|
|
878
878
|
// TODO 过滤掉部分属性
|
|
879
|
-
background:
|
|
879
|
+
background: o,
|
|
880
880
|
children: (await Promise.all(
|
|
881
|
-
e.elements.map(async (
|
|
881
|
+
e.elements.map(async (n) => {
|
|
882
882
|
try {
|
|
883
|
-
return await q(
|
|
883
|
+
return await q(n, void 0, i);
|
|
884
884
|
} catch (f) {
|
|
885
885
|
console.warn(f);
|
|
886
886
|
return;
|
|
@@ -895,22 +895,22 @@ async function St(e, r = !0, o) {
|
|
|
895
895
|
}
|
|
896
896
|
async function K(e, r = 0) {
|
|
897
897
|
const {
|
|
898
|
-
layouts:
|
|
898
|
+
layouts: i,
|
|
899
899
|
metas: t = {}
|
|
900
900
|
} = e, s = {
|
|
901
901
|
endTime: 0
|
|
902
902
|
};
|
|
903
|
-
let
|
|
904
|
-
|
|
903
|
+
let o = await Promise.all(
|
|
904
|
+
i.map(async (M, d) => ({
|
|
905
905
|
index: d,
|
|
906
906
|
element: await St(M, !0, s)
|
|
907
907
|
}))
|
|
908
|
-
),
|
|
909
|
-
|
|
908
|
+
), n = 0;
|
|
909
|
+
o = o.sort((M, d) => M.index - d.index).map((M, d) => {
|
|
910
910
|
const c = M.element;
|
|
911
|
-
return c.style && (c.style.top =
|
|
911
|
+
return c.style && (c.style.top = n, n += Number(c.style.height) + r), c.name = `Frame ${d + 1}`, c;
|
|
912
912
|
});
|
|
913
|
-
const f =
|
|
913
|
+
const f = o.reduce((M) => {
|
|
914
914
|
const d = M.style?.left ?? 0, c = M.style?.top ?? 0, a = M.style?.width ?? 0, l = M.style?.height ?? 0;
|
|
915
915
|
return {
|
|
916
916
|
minX: d,
|
|
@@ -925,7 +925,7 @@ async function K(e, r = 0) {
|
|
|
925
925
|
width: t?.width ?? f.maxX - f.minX,
|
|
926
926
|
height: t?.height ?? f.maxY - f.minY
|
|
927
927
|
},
|
|
928
|
-
children:
|
|
928
|
+
children: o,
|
|
929
929
|
meta: {
|
|
930
930
|
...t,
|
|
931
931
|
endTime: s.endTime,
|
|
@@ -934,46 +934,45 @@ async function K(e, r = 0) {
|
|
|
934
934
|
};
|
|
935
935
|
}
|
|
936
936
|
function zt(e, r) {
|
|
937
|
-
const { config:
|
|
937
|
+
const { config: i } = e;
|
|
938
938
|
return {
|
|
939
939
|
name: "bigesj:bidTid",
|
|
940
940
|
test: (t) => typeof t == "object" && t && !!(t.bid || t.tid),
|
|
941
941
|
load: async (t) => {
|
|
942
|
-
const s = t.bid ?? t.tid ?? "",
|
|
942
|
+
const s = t.bid ?? t.tid ?? "", o = async (c) => await fetch(
|
|
943
943
|
(t.bid ? r.bid : r.tid).replace("%d", c)
|
|
944
944
|
).then((a) => a.json()).then((a) => JSON.parse(a.data.content));
|
|
945
|
-
let
|
|
945
|
+
let n = 0;
|
|
946
946
|
const f = await Promise.all(
|
|
947
947
|
s.split("|").map(async (c) => {
|
|
948
948
|
let [a, l] = c.split("[");
|
|
949
949
|
l && (l = l.substring(0, l.length - 1));
|
|
950
|
-
const L = l ? l.split(",").map((m) => Number(m)) : void 0, w = await
|
|
950
|
+
const L = l ? l.split(",").map((m) => Number(m)) : void 0, w = await o(a);
|
|
951
951
|
L !== void 0 && (w.layouts = w.layouts.filter((m, C) => L.includes(C)));
|
|
952
952
|
const y = await K(w);
|
|
953
|
-
return
|
|
953
|
+
return n = Math.max(n, y.meta?.maxTime ?? 0), y;
|
|
954
954
|
})
|
|
955
955
|
), M = { ...f[0], id: s, children: [] };
|
|
956
|
-
M.meta ??= {}, M.meta.maxTime =
|
|
956
|
+
M.meta ??= {}, M.meta.maxTime = n, M.meta.inEditorIs = "Doc";
|
|
957
957
|
let d = 0;
|
|
958
958
|
return f.forEach((c) => {
|
|
959
959
|
let a = 0;
|
|
960
960
|
c.children?.forEach((l) => {
|
|
961
961
|
l.style && (l.style.left = d, a = Math.max(a, Number(l.style.width)), M.children.push(l));
|
|
962
|
-
}), d += a +
|
|
962
|
+
}), d += a + i.value.frameGap;
|
|
963
963
|
}), M;
|
|
964
964
|
}
|
|
965
965
|
};
|
|
966
966
|
}
|
|
967
|
-
function Nt(
|
|
968
|
-
const { config: r } = e;
|
|
967
|
+
function Nt() {
|
|
969
968
|
return {
|
|
970
969
|
name: "bigesj:bige",
|
|
971
970
|
accept: ".bige",
|
|
972
|
-
test: (
|
|
973
|
-
load: async (
|
|
971
|
+
test: (e) => e instanceof File && e.name.endsWith(".bige"),
|
|
972
|
+
load: async (e) => await K(
|
|
974
973
|
JSON.parse(
|
|
975
974
|
new TextDecoder().decode(
|
|
976
|
-
Lt(new Uint8Array(await
|
|
975
|
+
Lt(new Uint8Array(await e.arrayBuffer()))
|
|
977
976
|
)
|
|
978
977
|
).content
|
|
979
978
|
)
|
|
@@ -982,17 +981,17 @@ function Nt(e) {
|
|
|
982
981
|
function Qt(e = {}) {
|
|
983
982
|
const {
|
|
984
983
|
font: r,
|
|
985
|
-
api:
|
|
984
|
+
api: i
|
|
986
985
|
} = e, t = {
|
|
987
986
|
fonts: "/new/design/fonts",
|
|
988
987
|
bid: "/new/udesign/info/%d",
|
|
989
988
|
tid: "/new/design/info/%d",
|
|
990
|
-
...
|
|
989
|
+
...i
|
|
991
990
|
};
|
|
992
991
|
return ot((s) => ({
|
|
993
992
|
name: "bigesj",
|
|
994
993
|
loaders: [
|
|
995
|
-
Nt(
|
|
994
|
+
Nt(),
|
|
996
995
|
zt(s, t)
|
|
997
996
|
],
|
|
998
997
|
setup: async () => {
|
|
@@ -1002,18 +1001,18 @@ function Qt(e = {}) {
|
|
|
1002
1001
|
}
|
|
1003
1002
|
async function Et(e, r) {
|
|
1004
1003
|
const {
|
|
1005
|
-
on:
|
|
1004
|
+
on: i,
|
|
1006
1005
|
off: t,
|
|
1007
1006
|
root: s
|
|
1008
1007
|
} = e, {
|
|
1009
|
-
loadBigeFonts:
|
|
1010
|
-
loadFont:
|
|
1008
|
+
loadBigeFonts: o,
|
|
1009
|
+
loadFont: n
|
|
1011
1010
|
} = mt();
|
|
1012
1011
|
function f(c) {
|
|
1013
|
-
c instanceof nt && (c.style.fontFamily &&
|
|
1012
|
+
c instanceof nt && (c.style.fontFamily && n(c.style.fontFamily).then(() => c.text.update()), c.text.content.forEach((a) => {
|
|
1014
1013
|
a.fragments.forEach((l) => {
|
|
1015
|
-
l.fontFamily &&
|
|
1016
|
-
}), a.fontFamily &&
|
|
1014
|
+
l.fontFamily && n(l.fontFamily).then(() => c.text.update());
|
|
1015
|
+
}), a.fontFamily && n(a.fontFamily).then(() => c.text.update());
|
|
1017
1016
|
}));
|
|
1018
1017
|
}
|
|
1019
1018
|
function M(c) {
|
|
@@ -1026,7 +1025,7 @@ async function Et(e, r) {
|
|
|
1026
1025
|
}
|
|
1027
1026
|
lt(() => {
|
|
1028
1027
|
t("setDoc", d), t("addElement", M);
|
|
1029
|
-
}),
|
|
1028
|
+
}), i("setDoc", d), i("addElement", M), await o(r.fonts);
|
|
1030
1029
|
}
|
|
1031
1030
|
export {
|
|
1032
1031
|
zt as bidTidLoader,
|
package/dist/loaders/bige.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function bigeLoader(editor: Editor): Mce.Loader;
|
|
1
|
+
export declare function bigeLoader(): Mce.Loader;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mce/bigesj",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.6",
|
|
5
5
|
"description": "Plugin for mce",
|
|
6
6
|
"author": "wxm",
|
|
7
7
|
"license": "MIT",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"modern-font": "^0.4.4",
|
|
53
53
|
"modern-idoc": "^0.10.5",
|
|
54
54
|
"vue": "^3.5.22",
|
|
55
|
-
"mce": "0.2.
|
|
55
|
+
"mce": "0.2.6"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"mce": "^0"
|