draftify-react 0.3.0 → 0.3.1
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/draftify-react.es.js +228 -220
- package/dist/draftify-react.umd.js +4 -4
- package/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -530,13 +530,13 @@ const qr = {
|
|
|
530
530
|
test: /* @__PURE__ */ Yi("hsl", "hue"),
|
|
531
531
|
parse: /* @__PURE__ */ Jo("hue", "saturation", "lightness"),
|
|
532
532
|
transform: ({ hue: t, saturation: e, lightness: n, alpha: r = 1 }) => "hsla(" + Math.round(t) + ", " + Kt.transform(cn(e)) + ", " + Kt.transform(cn(n)) + ", " + cn(gn.transform(r)) + ")"
|
|
533
|
-
},
|
|
533
|
+
}, ht = {
|
|
534
534
|
test: (t) => we.test(t) || qr.test(t) || De.test(t),
|
|
535
535
|
parse: (t) => we.test(t) ? we.parse(t) : De.test(t) ? De.parse(t) : qr.parse(t),
|
|
536
536
|
transform: (t) => typeof t == "string" ? t : t.hasOwnProperty("red") ? we.transform(t) : De.transform(t),
|
|
537
537
|
getAnimatableNone: (t) => {
|
|
538
|
-
const e =
|
|
539
|
-
return e.alpha = 0,
|
|
538
|
+
const e = ht.parse(t);
|
|
539
|
+
return e.alpha = 0, ht.transform(e);
|
|
540
540
|
}
|
|
541
541
|
}, Qf = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
|
|
542
542
|
function Zf(t) {
|
|
@@ -550,7 +550,7 @@ function yn(t) {
|
|
|
550
550
|
var: []
|
|
551
551
|
}, i = [];
|
|
552
552
|
let a = 0;
|
|
553
|
-
const o = e.replace(ed, (c) => (
|
|
553
|
+
const o = e.replace(ed, (c) => (ht.test(c) ? (r.color.push(a), i.push(el), n.push(ht.parse(c))) : c.startsWith(td) ? (r.var.push(a), i.push(Jf), n.push(c)) : (r.number.push(a), i.push(tl), n.push(parseFloat(c))), ++a, _a)).split(_a);
|
|
554
554
|
return { values: n, split: o, indexes: r, types: i };
|
|
555
555
|
}
|
|
556
556
|
function nl(t) {
|
|
@@ -563,12 +563,12 @@ function rl(t) {
|
|
|
563
563
|
for (let s = 0; s < r; s++)
|
|
564
564
|
if (a += e[s], i[s] !== void 0) {
|
|
565
565
|
const o = n[s];
|
|
566
|
-
o === tl ? a += cn(i[s]) : o === el ? a +=
|
|
566
|
+
o === tl ? a += cn(i[s]) : o === el ? a += ht.transform(i[s]) : a += i[s];
|
|
567
567
|
}
|
|
568
568
|
return a;
|
|
569
569
|
};
|
|
570
570
|
}
|
|
571
|
-
const nd = (t) => typeof t == "number" ? 0 :
|
|
571
|
+
const nd = (t) => typeof t == "number" ? 0 : ht.test(t) ? ht.getAnimatableNone(t) : t;
|
|
572
572
|
function rd(t) {
|
|
573
573
|
const e = nl(t);
|
|
574
574
|
return rl(t)(e.map(nd));
|
|
@@ -601,7 +601,7 @@ function id({ hue: t, saturation: e, lightness: n, alpha: r }) {
|
|
|
601
601
|
function Gn(t, e) {
|
|
602
602
|
return (n) => n > 0 ? e : t;
|
|
603
603
|
}
|
|
604
|
-
const
|
|
604
|
+
const ft = (t, e, n) => t + (e - t) * n, Ir = (t, e, n) => {
|
|
605
605
|
const r = t * t, i = n * (e * e - r) + r;
|
|
606
606
|
return i < 0 ? 0 : Math.sqrt(i);
|
|
607
607
|
}, ad = [qr, we, De], sd = (t) => ad.find((e) => e.test(t));
|
|
@@ -617,16 +617,16 @@ const Na = (t, e) => {
|
|
|
617
617
|
if (!n || !r)
|
|
618
618
|
return Gn(t, e);
|
|
619
619
|
const i = { ...n };
|
|
620
|
-
return (a) => (i.red = Ir(n.red, r.red, a), i.green = Ir(n.green, r.green, a), i.blue = Ir(n.blue, r.blue, a), i.alpha =
|
|
620
|
+
return (a) => (i.red = Ir(n.red, r.red, a), i.green = Ir(n.green, r.green, a), i.blue = Ir(n.blue, r.blue, a), i.alpha = ft(n.alpha, r.alpha, a), we.transform(i));
|
|
621
621
|
}, Qr = /* @__PURE__ */ new Set(["none", "hidden"]);
|
|
622
622
|
function od(t, e) {
|
|
623
623
|
return Qr.has(t) ? (n) => n <= 0 ? t : e : (n) => n >= 1 ? e : t;
|
|
624
624
|
}
|
|
625
625
|
function ld(t, e) {
|
|
626
|
-
return (n) =>
|
|
626
|
+
return (n) => ft(t, e, n);
|
|
627
627
|
}
|
|
628
628
|
function Gi(t) {
|
|
629
|
-
return typeof t == "number" ? ld : typeof t == "string" ? Wi(t) ? Gn :
|
|
629
|
+
return typeof t == "number" ? ld : typeof t == "string" ? Wi(t) ? Gn : ht.test(t) ? Na : fd : Array.isArray(t) ? il : typeof t == "object" ? ht.test(t) ? Na : cd : Gn;
|
|
630
630
|
}
|
|
631
631
|
function il(t, e) {
|
|
632
632
|
const n = [...t], r = n.length, i = t.map((a, s) => Gi(a)(a, e[s]));
|
|
@@ -659,7 +659,7 @@ const fd = (t, e) => {
|
|
|
659
659
|
return r.indexes.var.length === i.indexes.var.length && r.indexes.color.length === i.indexes.color.length && r.indexes.number.length >= i.indexes.number.length ? Qr.has(t) && !i.values.length || Qr.has(e) && !r.values.length ? od(t, e) : An(il(ud(r, i), i.values), n) : (Xe(!0, `Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`, "complex-values-different"), Gn(t, e));
|
|
660
660
|
};
|
|
661
661
|
function al(t, e, n) {
|
|
662
|
-
return typeof t == "number" && typeof e == "number" && typeof n == "number" ?
|
|
662
|
+
return typeof t == "number" && typeof e == "number" && typeof n == "number" ? ft(t, e, n) : Gi(t)(t, e);
|
|
663
663
|
}
|
|
664
664
|
const dd = (t) => {
|
|
665
665
|
const e = ({ timestamp: n }) => t(n);
|
|
@@ -700,7 +700,7 @@ function ol(t, e, n) {
|
|
|
700
700
|
const r = Math.max(e - md, 0);
|
|
701
701
|
return No(n - t(r), e - r);
|
|
702
702
|
}
|
|
703
|
-
const
|
|
703
|
+
const ut = {
|
|
704
704
|
// Default spring physics
|
|
705
705
|
stiffness: 100,
|
|
706
706
|
damping: 10,
|
|
@@ -729,11 +729,11 @@ const ct = {
|
|
|
729
729
|
minDamping: 0.05,
|
|
730
730
|
maxDamping: 1
|
|
731
731
|
}, Mr = 1e-3;
|
|
732
|
-
function pd({ duration: t =
|
|
732
|
+
function pd({ duration: t = ut.duration, bounce: e = ut.bounce, velocity: n = ut.velocity, mass: r = ut.mass }) {
|
|
733
733
|
let i, a;
|
|
734
|
-
Xe(t <= /* @__PURE__ */ zt(
|
|
734
|
+
Xe(t <= /* @__PURE__ */ zt(ut.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
|
|
735
735
|
let s = 1 - e;
|
|
736
|
-
s = Jt(
|
|
736
|
+
s = Jt(ut.minDamping, ut.maxDamping, s), t = Jt(ut.minDuration, ut.maxDuration, /* @__PURE__ */ Lt(t)), s < 1 ? (i = (d) => {
|
|
737
737
|
const l = d * s, u = l * t, f = l - n, h = Zr(d, s), m = Math.exp(-u);
|
|
738
738
|
return Mr - f / h * m;
|
|
739
739
|
}, a = (d) => {
|
|
@@ -749,8 +749,8 @@ function pd({ duration: t = ct.duration, bounce: e = ct.bounce, velocity: n = ct
|
|
|
749
749
|
const o = 5 / t, c = yd(i, a, o);
|
|
750
750
|
if (t = /* @__PURE__ */ zt(t), isNaN(c))
|
|
751
751
|
return {
|
|
752
|
-
stiffness:
|
|
753
|
-
damping:
|
|
752
|
+
stiffness: ut.stiffness,
|
|
753
|
+
damping: ut.damping,
|
|
754
754
|
duration: t
|
|
755
755
|
};
|
|
756
756
|
{
|
|
@@ -778,10 +778,10 @@ function Ua(t, e) {
|
|
|
778
778
|
}
|
|
779
779
|
function xd(t) {
|
|
780
780
|
let e = {
|
|
781
|
-
velocity:
|
|
782
|
-
stiffness:
|
|
783
|
-
damping:
|
|
784
|
-
mass:
|
|
781
|
+
velocity: ut.velocity,
|
|
782
|
+
stiffness: ut.stiffness,
|
|
783
|
+
damping: ut.damping,
|
|
784
|
+
mass: ut.mass,
|
|
785
785
|
isResolvedFromDuration: !1,
|
|
786
786
|
...t
|
|
787
787
|
};
|
|
@@ -790,7 +790,7 @@ function xd(t) {
|
|
|
790
790
|
const n = t.visualDuration, r = 2 * Math.PI / (n * 1.2), i = r * r, a = 2 * Jt(0.05, 1, 1 - (t.bounce || 0)) * Math.sqrt(i);
|
|
791
791
|
e = {
|
|
792
792
|
...e,
|
|
793
|
-
mass:
|
|
793
|
+
mass: ut.mass,
|
|
794
794
|
stiffness: i,
|
|
795
795
|
damping: a
|
|
796
796
|
};
|
|
@@ -799,12 +799,12 @@ function xd(t) {
|
|
|
799
799
|
e = {
|
|
800
800
|
...e,
|
|
801
801
|
...n,
|
|
802
|
-
mass:
|
|
802
|
+
mass: ut.mass
|
|
803
803
|
}, e.isResolvedFromDuration = !0;
|
|
804
804
|
}
|
|
805
805
|
return e;
|
|
806
806
|
}
|
|
807
|
-
function Xn(t =
|
|
807
|
+
function Xn(t = ut.visualDuration, e = ut.bounce) {
|
|
808
808
|
const n = typeof t != "object" ? {
|
|
809
809
|
visualDuration: t,
|
|
810
810
|
keyframes: [0, 1],
|
|
@@ -815,7 +815,7 @@ function Xn(t = ct.visualDuration, e = ct.bounce) {
|
|
|
815
815
|
...n,
|
|
816
816
|
velocity: -/* @__PURE__ */ Lt(n.velocity || 0)
|
|
817
817
|
}), m = f || 0, b = d / (2 * Math.sqrt(c * l)), w = s - a, v = /* @__PURE__ */ Lt(Math.sqrt(c / l)), k = Math.abs(w) < 5;
|
|
818
|
-
r || (r = k ?
|
|
818
|
+
r || (r = k ? ut.restSpeed.granular : ut.restSpeed.default), i || (i = k ? ut.restDelta.granular : ut.restDelta.default);
|
|
819
819
|
let S;
|
|
820
820
|
if (b < 1) {
|
|
821
821
|
const P = Zr(v, b);
|
|
@@ -927,7 +927,7 @@ function Sd(t, e) {
|
|
|
927
927
|
const n = t[t.length - 1];
|
|
928
928
|
for (let r = 1; r <= e; r++) {
|
|
929
929
|
const i = /* @__PURE__ */ pn(0, e, r);
|
|
930
|
-
t.push(
|
|
930
|
+
t.push(ft(n, 1, i));
|
|
931
931
|
}
|
|
932
932
|
}
|
|
933
933
|
function Td(t) {
|
|
@@ -1723,17 +1723,17 @@ const uh = /\b([a-z-]*)\(.*?\)/gu, li = {
|
|
|
1723
1723
|
}, dh = {
|
|
1724
1724
|
...ta,
|
|
1725
1725
|
// Color props
|
|
1726
|
-
color:
|
|
1727
|
-
backgroundColor:
|
|
1728
|
-
outlineColor:
|
|
1729
|
-
fill:
|
|
1730
|
-
stroke:
|
|
1726
|
+
color: ht,
|
|
1727
|
+
backgroundColor: ht,
|
|
1728
|
+
outlineColor: ht,
|
|
1729
|
+
fill: ht,
|
|
1730
|
+
stroke: ht,
|
|
1731
1731
|
// Border props
|
|
1732
|
-
borderColor:
|
|
1733
|
-
borderTopColor:
|
|
1734
|
-
borderRightColor:
|
|
1735
|
-
borderBottomColor:
|
|
1736
|
-
borderLeftColor:
|
|
1732
|
+
borderColor: ht,
|
|
1733
|
+
borderTopColor: ht,
|
|
1734
|
+
borderRightColor: ht,
|
|
1735
|
+
borderBottomColor: ht,
|
|
1736
|
+
borderLeftColor: ht,
|
|
1737
1737
|
filter: li,
|
|
1738
1738
|
WebkitFilter: li
|
|
1739
1739
|
}, bl = (t) => dh[t];
|
|
@@ -2125,7 +2125,7 @@ function Cl(t) {
|
|
|
2125
2125
|
function Ph(t) {
|
|
2126
2126
|
return Cl(t) && t.tagName === "svg";
|
|
2127
2127
|
}
|
|
2128
|
-
const St = (t) => !!(t && t.getVelocity), Ch = [...vl,
|
|
2128
|
+
const St = (t) => !!(t && t.getVelocity), Ch = [...vl, ht, ue], Eh = (t) => Ch.find(yl(t)), ra = Ke({
|
|
2129
2129
|
transformPagePoint: (t) => t,
|
|
2130
2130
|
isStatic: !1,
|
|
2131
2131
|
reducedMotion: "never"
|
|
@@ -2421,7 +2421,7 @@ const an = {
|
|
|
2421
2421
|
return r;
|
|
2422
2422
|
const a = ue.createTransformer(t), s = typeof i[0] != "number" ? 1 : 0, o = n.x.scale * e.x, c = n.y.scale * e.y;
|
|
2423
2423
|
i[0 + s] /= o, i[1 + s] /= c;
|
|
2424
|
-
const d =
|
|
2424
|
+
const d = ft(o, c, 0.5);
|
|
2425
2425
|
return typeof i[2 + s] == "number" && (i[2 + s] /= d), typeof i[3 + s] == "number" && (i[3 + s] /= d), a(i);
|
|
2426
2426
|
}
|
|
2427
2427
|
}, ci = {
|
|
@@ -2891,7 +2891,7 @@ function Oe(t, e) {
|
|
|
2891
2891
|
t.min = t.min + e, t.max = t.max + e;
|
|
2892
2892
|
}
|
|
2893
2893
|
function us(t, e, n, r, i = 0.5) {
|
|
2894
|
-
const a =
|
|
2894
|
+
const a = ft(t.min, t.max, i);
|
|
2895
2895
|
fi(t, e, n, a, r);
|
|
2896
2896
|
}
|
|
2897
2897
|
function _e(t, e) {
|
|
@@ -2912,7 +2912,7 @@ const fs = () => ({
|
|
|
2912
2912
|
}), Ve = () => ({
|
|
2913
2913
|
x: fs(),
|
|
2914
2914
|
y: fs()
|
|
2915
|
-
}), ds = () => ({ min: 0, max: 0 }),
|
|
2915
|
+
}), ds = () => ({ min: 0, max: 0 }), mt = () => ({
|
|
2916
2916
|
x: ds(),
|
|
2917
2917
|
y: ds()
|
|
2918
2918
|
}), di = { current: null }, Hl = { current: !1 };
|
|
@@ -3036,7 +3036,7 @@ class xm {
|
|
|
3036
3036
|
* removed with a re-render to work.
|
|
3037
3037
|
*/
|
|
3038
3038
|
measureViewportBox() {
|
|
3039
|
-
return this.current ? this.measureInstanceViewportBox(this.current, this.props) :
|
|
3039
|
+
return this.current ? this.measureInstanceViewportBox(this.current, this.props) : mt();
|
|
3040
3040
|
}
|
|
3041
3041
|
getStaticValue(e) {
|
|
3042
3042
|
return this.latestValues[e];
|
|
@@ -3243,7 +3243,7 @@ function Sm(t, e, n, r) {
|
|
|
3243
3243
|
}
|
|
3244
3244
|
class Tm extends Yl {
|
|
3245
3245
|
constructor() {
|
|
3246
|
-
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox =
|
|
3246
|
+
super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = mt;
|
|
3247
3247
|
}
|
|
3248
3248
|
getBaseTargetFromProps(e, n) {
|
|
3249
3249
|
return e[n];
|
|
@@ -3681,7 +3681,7 @@ function np(t, e, n) {
|
|
|
3681
3681
|
return Math.abs(t - e) <= n;
|
|
3682
3682
|
}
|
|
3683
3683
|
function ps(t, e, n, r = 0.5) {
|
|
3684
|
-
t.origin = r, t.originPoint =
|
|
3684
|
+
t.origin = r, t.originPoint = ft(e.min, e.max, t.origin), t.scale = Pt(n) / Pt(e), t.translate = ft(n.min, n.max, t.origin) - t.originPoint, (t.scale >= Zm && t.scale <= Jm || isNaN(t.scale)) && (t.scale = 1), (t.translate >= tp && t.translate <= ep || isNaN(t.translate)) && (t.translate = 0);
|
|
3685
3685
|
}
|
|
3686
3686
|
function fn(t, e, n, r) {
|
|
3687
3687
|
ps(t.x, e.x, n.x, r ? r.originX : void 0), ps(t.y, e.y, n.y, r ? r.originY : void 0);
|
|
@@ -3781,7 +3781,7 @@ function sp(t, e) {
|
|
|
3781
3781
|
return s.x === 1 / 0 && (s.x = 0), s.y === 1 / 0 && (s.y = 0), s;
|
|
3782
3782
|
}
|
|
3783
3783
|
function op(t, { min: e, max: n }, r) {
|
|
3784
|
-
return e !== void 0 && t < e ? t = r ?
|
|
3784
|
+
return e !== void 0 && t < e ? t = r ? ft(e, t, r.min) : Math.max(t, e) : n !== void 0 && t > n && (t = r ? ft(n, t, r.max) : Math.min(t, n)), t;
|
|
3785
3785
|
}
|
|
3786
3786
|
function xs(t, e, n) {
|
|
3787
3787
|
return {
|
|
@@ -3833,7 +3833,7 @@ function Ss(t, e) {
|
|
|
3833
3833
|
const hp = /* @__PURE__ */ new WeakMap();
|
|
3834
3834
|
class mp {
|
|
3835
3835
|
constructor(e) {
|
|
3836
|
-
this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic =
|
|
3836
|
+
this.openDragLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = mt(), this.latestPointerEvent = null, this.latestPanInfo = null, this.visualElement = e;
|
|
3837
3837
|
}
|
|
3838
3838
|
start(e, { snapToCursor: n = !1, distanceThreshold: r } = {}) {
|
|
3839
3839
|
const { presenceContext: i } = this.visualElement;
|
|
@@ -3991,7 +3991,7 @@ class mp {
|
|
|
3991
3991
|
const { projection: i } = this.visualElement, a = this.getAxisMotionValue(n);
|
|
3992
3992
|
if (i && i.layout) {
|
|
3993
3993
|
const { min: s, max: o } = i.layout.layoutBox[n];
|
|
3994
|
-
a.set(e[n] -
|
|
3994
|
+
a.set(e[n] - ft(s, o, 0.5));
|
|
3995
3995
|
}
|
|
3996
3996
|
});
|
|
3997
3997
|
}
|
|
@@ -4020,7 +4020,7 @@ class mp {
|
|
|
4020
4020
|
if (!On(s, e, null))
|
|
4021
4021
|
return;
|
|
4022
4022
|
const o = this.getAxisMotionValue(s), { min: c, max: d } = this.constraints[s];
|
|
4023
|
-
o.set(
|
|
4023
|
+
o.set(ft(c, d, i[s]));
|
|
4024
4024
|
});
|
|
4025
4025
|
}
|
|
4026
4026
|
addListeners() {
|
|
@@ -4196,15 +4196,15 @@ function Ap(t, e) {
|
|
|
4196
4196
|
}
|
|
4197
4197
|
const sc = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], Sp = sc.length, Ps = (t) => typeof t == "string" ? parseFloat(t) : t, Cs = (t) => typeof t == "number" || X.test(t);
|
|
4198
4198
|
function Tp(t, e, n, r, i, a) {
|
|
4199
|
-
i ? (t.opacity =
|
|
4199
|
+
i ? (t.opacity = ft(0, n.opacity ?? 1, Pp(r)), t.opacityExit = ft(e.opacity ?? 1, 0, Cp(r))) : a && (t.opacity = ft(e.opacity ?? 1, n.opacity ?? 1, r));
|
|
4200
4200
|
for (let s = 0; s < Sp; s++) {
|
|
4201
4201
|
const o = `border${sc[s]}Radius`;
|
|
4202
4202
|
let c = Es(e, o), d = Es(n, o);
|
|
4203
4203
|
if (c === void 0 && d === void 0)
|
|
4204
4204
|
continue;
|
|
4205
|
-
c || (c = 0), d || (d = 0), c === 0 || d === 0 || Cs(c) === Cs(d) ? (t[o] = Math.max(
|
|
4205
|
+
c || (c = 0), d || (d = 0), c === 0 || d === 0 || Cs(c) === Cs(d) ? (t[o] = Math.max(ft(Ps(c), Ps(d), r), 0), (Kt.test(d) || Kt.test(c)) && (t[o] += "%")) : t[o] = d;
|
|
4206
4206
|
}
|
|
4207
|
-
(e.rotate || n.rotate) && (t.rotate =
|
|
4207
|
+
(e.rotate || n.rotate) && (t.rotate = ft(e.rotate || 0, n.rotate || 0, r));
|
|
4208
4208
|
}
|
|
4209
4209
|
function Es(t, e) {
|
|
4210
4210
|
return t[e] !== void 0 ? t[e] : t.borderRadius;
|
|
@@ -4226,9 +4226,9 @@ function Ms(t, e, n, r, i) {
|
|
|
4226
4226
|
return t -= e, t = Qn(t, 1 / n, r), i !== void 0 && (t = Qn(t, 1 / i, r)), t;
|
|
4227
4227
|
}
|
|
4228
4228
|
function Ep(t, e = 0, n = 1, r = 0.5, i, a = t, s = t) {
|
|
4229
|
-
if (Kt.test(e) && (e = parseFloat(e), e =
|
|
4229
|
+
if (Kt.test(e) && (e = parseFloat(e), e = ft(s.min, s.max, e / 100) - s.min), typeof e != "number")
|
|
4230
4230
|
return;
|
|
4231
|
-
let o =
|
|
4231
|
+
let o = ft(a.min, a.max, r);
|
|
4232
4232
|
t === a && (o -= e), t.min = Ms(t.min, e, n, o, i), t.max = Ms(t.max, e, n, o, i);
|
|
4233
4233
|
}
|
|
4234
4234
|
function Rs(t, e, [n, r, i], a, s) {
|
|
@@ -4489,7 +4489,7 @@ function fc({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4489
4489
|
for (let c = 0; c < this.path.length; c++)
|
|
4490
4490
|
this.path[c].updateScroll();
|
|
4491
4491
|
const s = this.layout;
|
|
4492
|
-
this.layout = this.measure(!1), this.layoutVersion++, this.layoutCorrected =
|
|
4492
|
+
this.layout = this.measure(!1), this.layoutVersion++, this.layoutCorrected = mt(), this.isLayoutDirty = !1, this.projectionDelta = void 0, this.notifyListeners("measure", this.layout.layoutBox);
|
|
4493
4493
|
const { visualElement: o } = this.options;
|
|
4494
4494
|
o && o.notify("LayoutMeasure", this.layout.layoutBox, s ? s.layoutBox : void 0);
|
|
4495
4495
|
}
|
|
@@ -4526,7 +4526,7 @@ function fc({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4526
4526
|
measurePageBox() {
|
|
4527
4527
|
const { visualElement: s } = this.options;
|
|
4528
4528
|
if (!s)
|
|
4529
|
-
return
|
|
4529
|
+
return mt();
|
|
4530
4530
|
const o = s.measureViewportBox();
|
|
4531
4531
|
if (!(this.scroll?.wasRoot || this.path.some(Xp))) {
|
|
4532
4532
|
const { scroll: d } = this.root;
|
|
@@ -4535,7 +4535,7 @@ function fc({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4535
4535
|
return o;
|
|
4536
4536
|
}
|
|
4537
4537
|
removeElementScroll(s) {
|
|
4538
|
-
const o =
|
|
4538
|
+
const o = mt();
|
|
4539
4539
|
if (Vt(o, s), this.scroll?.wasRoot)
|
|
4540
4540
|
return o;
|
|
4541
4541
|
for (let c = 0; c < this.path.length; c++) {
|
|
@@ -4545,7 +4545,7 @@ function fc({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4545
4545
|
return o;
|
|
4546
4546
|
}
|
|
4547
4547
|
applyTransform(s, o = !1) {
|
|
4548
|
-
const c =
|
|
4548
|
+
const c = mt();
|
|
4549
4549
|
Vt(c, s);
|
|
4550
4550
|
for (let d = 0; d < this.path.length; d++) {
|
|
4551
4551
|
const l = this.path[d];
|
|
@@ -4557,14 +4557,14 @@ function fc({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4557
4557
|
return xe(this.latestValues) && _e(c, this.latestValues), c;
|
|
4558
4558
|
}
|
|
4559
4559
|
removeTransform(s) {
|
|
4560
|
-
const o =
|
|
4560
|
+
const o = mt();
|
|
4561
4561
|
Vt(o, s);
|
|
4562
4562
|
for (let c = 0; c < this.path.length; c++) {
|
|
4563
4563
|
const d = this.path[c];
|
|
4564
4564
|
if (!d.instance || !xe(d.latestValues))
|
|
4565
4565
|
continue;
|
|
4566
4566
|
ui(d.latestValues) && d.updateSnapshot();
|
|
4567
|
-
const l =
|
|
4567
|
+
const l = mt(), u = d.measurePageBox();
|
|
4568
4568
|
Vt(l, u), Fs(o, d.latestValues, d.snapshot ? d.snapshot.layoutBox : void 0, l);
|
|
4569
4569
|
}
|
|
4570
4570
|
return xe(this.latestValues) && Fs(o, this.latestValues), o;
|
|
@@ -4596,7 +4596,7 @@ function fc({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4596
4596
|
return;
|
|
4597
4597
|
this.resolvedRelativeTargetAt = vt.timestamp;
|
|
4598
4598
|
const f = this.getClosestProjectingParent();
|
|
4599
|
-
f && this.linkedParentVersion !== f.layoutVersion && !f.options.layoutRoot && this.removeRelativeTarget(), !this.targetDelta && !this.relativeTarget && (f && f.layout ? this.createRelativeTarget(f, this.layout.layoutBox, f.layout.layoutBox) : this.removeRelativeTarget()), !(!this.relativeTarget && !this.targetDelta) && (this.target || (this.target =
|
|
4599
|
+
f && this.linkedParentVersion !== f.layoutVersion && !f.options.layoutRoot && this.removeRelativeTarget(), !this.targetDelta && !this.relativeTarget && (f && f.layout ? this.createRelativeTarget(f, this.layout.layoutBox, f.layout.layoutBox) : this.removeRelativeTarget()), !(!this.relativeTarget && !this.targetDelta) && (this.target || (this.target = mt(), this.targetWithTransforms = mt()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), rp(this.target, this.relativeTarget, this.relativeParent.target)) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.layoutBox) : Vt(this.target, this.layout.layoutBox), $l(this.target, this.targetDelta)) : Vt(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget && (this.attemptToResolveRelativeTarget = !1, f && !!f.resumingFrom == !!this.resumingFrom && !f.options.layoutScroll && f.target && this.animationProgress !== 1 ? this.createRelativeTarget(f, this.target, f.target) : this.relativeParent = this.relativeTarget = void 0));
|
|
4600
4600
|
}
|
|
4601
4601
|
getClosestProjectingParent() {
|
|
4602
4602
|
if (!(!this.parent || ui(this.parent.latestValues) || zl(this.parent.latestValues)))
|
|
@@ -4606,7 +4606,7 @@ function fc({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4606
4606
|
return !!((this.relativeTarget || this.targetDelta || this.options.layoutRoot) && this.layout);
|
|
4607
4607
|
}
|
|
4608
4608
|
createRelativeTarget(s, o, c) {
|
|
4609
|
-
this.relativeParent = s, this.linkedParentVersion = s.layoutVersion, this.forceRelativeParentToResolveTarget(), this.relativeTarget =
|
|
4609
|
+
this.relativeParent = s, this.linkedParentVersion = s.layoutVersion, this.forceRelativeParentToResolveTarget(), this.relativeTarget = mt(), this.relativeTargetOrigin = mt(), Zn(this.relativeTargetOrigin, o, c), Vt(this.relativeTarget, this.relativeTargetOrigin);
|
|
4610
4610
|
}
|
|
4611
4611
|
removeRelativeTarget() {
|
|
4612
4612
|
this.relativeParent = this.relativeTarget = void 0;
|
|
@@ -4621,7 +4621,7 @@ function fc({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4621
4621
|
return;
|
|
4622
4622
|
Vt(this.layoutCorrected, this.layout.layoutBox);
|
|
4623
4623
|
const u = this.treeScale.x, f = this.treeScale.y;
|
|
4624
|
-
pm(this.layoutCorrected, this.treeScale, this.path, o), s.layout && !s.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (s.target = s.layout.layoutBox, s.targetWithTransforms =
|
|
4624
|
+
pm(this.layoutCorrected, this.treeScale, this.path, o), s.layout && !s.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (s.target = s.layout.layoutBox, s.targetWithTransforms = mt());
|
|
4625
4625
|
const { target: h } = s;
|
|
4626
4626
|
if (!h) {
|
|
4627
4627
|
this.prevProjectionDelta && (this.createProjectionDeltas(), this.scheduleRender());
|
|
@@ -4648,12 +4648,12 @@ function fc({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4648
4648
|
setAnimationOrigin(s, o = !1) {
|
|
4649
4649
|
const c = this.snapshot, d = c ? c.latestValues : {}, l = { ...this.latestValues }, u = Ve();
|
|
4650
4650
|
(!this.relativeParent || !this.relativeParent.options.layoutRoot) && (this.relativeTarget = this.relativeTargetOrigin = void 0), this.attemptToResolveRelativeTarget = !o;
|
|
4651
|
-
const f =
|
|
4651
|
+
const f = mt(), h = c ? c.source : void 0, m = this.layout ? this.layout.source : void 0, b = h !== m, w = this.getStack(), v = !w || w.members.length <= 1, k = !!(b && !v && this.options.crossfade === !0 && !this.path.some(Yp));
|
|
4652
4652
|
this.animationProgress = 0;
|
|
4653
4653
|
let S;
|
|
4654
4654
|
this.mixTargetDelta = (E) => {
|
|
4655
4655
|
const P = E / 1e3;
|
|
4656
|
-
Bs(u.x, s.x, P), Bs(u.y, s.y, P), this.setTargetDelta(u), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (Zn(f, this.layout.layoutBox, this.relativeParent.layout.layoutBox), Hp(this.relativeTarget, this.relativeTargetOrigin, f, P), S && Mp(this.relativeTarget, S) && (this.isProjectionDirty = !1), S || (S =
|
|
4656
|
+
Bs(u.x, s.x, P), Bs(u.y, s.y, P), this.setTargetDelta(u), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (Zn(f, this.layout.layoutBox, this.relativeParent.layout.layoutBox), Hp(this.relativeTarget, this.relativeTargetOrigin, f, P), S && Mp(this.relativeTarget, S) && (this.isProjectionDirty = !1), S || (S = mt()), Vt(S, this.relativeTarget)), b && (this.animationValues = l, Tp(l, d, this.latestValues, P, k, v)), this.root.scheduleUpdateProjection(), this.scheduleRender(), this.animationProgress = P;
|
|
4657
4657
|
}, this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
|
|
4658
4658
|
}
|
|
4659
4659
|
startAnimation(s) {
|
|
@@ -4686,7 +4686,7 @@ function fc({ attachResizeListener: t, defaultParent: e, measureScroll: n, check
|
|
|
4686
4686
|
let { targetWithTransforms: o, target: c, layout: d, latestValues: l } = s;
|
|
4687
4687
|
if (!(!o || !c || !d)) {
|
|
4688
4688
|
if (this !== s && this.layout && d && dc(this.options.animationType, this.layout.layoutBox, d.layoutBox)) {
|
|
4689
|
-
c = this.target ||
|
|
4689
|
+
c = this.target || mt();
|
|
4690
4690
|
const u = Pt(this.layout.layoutBox.x);
|
|
4691
4691
|
c.x.min = s.target.x.min, c.x.max = c.x.min + u;
|
|
4692
4692
|
const f = Pt(this.layout.layoutBox.y);
|
|
@@ -4816,9 +4816,9 @@ function Op(t) {
|
|
|
4816
4816
|
if (l && !l.resumeFrom) {
|
|
4817
4817
|
const { snapshot: u, layout: f } = l;
|
|
4818
4818
|
if (u && f) {
|
|
4819
|
-
const h =
|
|
4819
|
+
const h = mt();
|
|
4820
4820
|
Zn(h, e.layoutBox, u.layoutBox);
|
|
4821
|
-
const m =
|
|
4821
|
+
const m = mt();
|
|
4822
4822
|
Zn(m, n, f.layoutBox), cc(h, m) || (d = !0), l.options.layoutRoot && (t.relativeTarget = m, t.relativeTargetOrigin = h, t.relativeParent = l);
|
|
4823
4823
|
}
|
|
4824
4824
|
}
|
|
@@ -4872,10 +4872,10 @@ function Wp(t) {
|
|
|
4872
4872
|
t.removeLeadSnapshot();
|
|
4873
4873
|
}
|
|
4874
4874
|
function Bs(t, e, n) {
|
|
4875
|
-
t.translate =
|
|
4875
|
+
t.translate = ft(e.translate, 0, n), t.scale = ft(e.scale, 1, n), t.origin = e.origin, t.originPoint = e.originPoint;
|
|
4876
4876
|
}
|
|
4877
4877
|
function zs(t, e, n, r) {
|
|
4878
|
-
t.min =
|
|
4878
|
+
t.min = ft(e.min, n.min, r), t.max = ft(e.max, n.max, r);
|
|
4879
4879
|
}
|
|
4880
4880
|
function Hp(t, e, n, r) {
|
|
4881
4881
|
zs(t.x, e.x, n.x, r), zs(t.y, e.y, n.y, r);
|
|
@@ -9870,54 +9870,54 @@ const Nt = (function() {
|
|
|
9870
9870
|
const F = M[0], C = M[1], O = M[2], x = M[3], g = M[4], _ = M[5];
|
|
9871
9871
|
let j = 6, U = 8, D = 255;
|
|
9872
9872
|
for (var N = 0; N < p.length; N++) {
|
|
9873
|
-
const
|
|
9874
|
-
for (var $ =
|
|
9873
|
+
const gt = new Uint8Array(p[N]);
|
|
9874
|
+
for (var $ = gt.length, B = 0; B < $; B += 4) D &= gt[B + 3];
|
|
9875
9875
|
}
|
|
9876
|
-
const V = D != 255, K = (function(it,
|
|
9877
|
-
const
|
|
9876
|
+
const V = D != 255, K = (function(it, rt, ct, yt, et, It) {
|
|
9877
|
+
const dt = [];
|
|
9878
9878
|
for (var at = 0; at < it.length; at++) {
|
|
9879
9879
|
const Tt = new Uint8Array(it[at]), _t = new Uint32Array(Tt.buffer);
|
|
9880
9880
|
var Mt;
|
|
9881
|
-
let Ft = 0, qt = 0, Wt =
|
|
9881
|
+
let Ft = 0, qt = 0, Wt = rt, ge = ct, Sr = yt ? 1 : 0;
|
|
9882
9882
|
if (at != 0) {
|
|
9883
|
-
const ju = It ||
|
|
9883
|
+
const ju = It || yt || at == 1 || dt[at - 2].dispose != 0 ? 1 : 2;
|
|
9884
9884
|
let Tr = 0, Ea = 1e9;
|
|
9885
9885
|
for (let tn = 0; tn < ju; tn++) {
|
|
9886
9886
|
var ae = new Uint8Array(it[at - 1 - tn]);
|
|
9887
9887
|
const Lu = new Uint32Array(it[at - 1 - tn]);
|
|
9888
|
-
let se =
|
|
9889
|
-
for (let ye = 0; ye <
|
|
9890
|
-
_t[xt = ye *
|
|
9891
|
-
Me == -1 && (se = oe = Me = en = 0),
|
|
9888
|
+
let se = rt, oe = ct, Me = -1, en = -1;
|
|
9889
|
+
for (let ye = 0; ye < ct; ye++) for (let ve = 0; ve < rt; ve++)
|
|
9890
|
+
_t[xt = ye * rt + ve] != Lu[xt] && (ve < se && (se = ve), ve > Me && (Me = ve), ye < oe && (oe = ye), ye > en && (en = ye));
|
|
9891
|
+
Me == -1 && (se = oe = Me = en = 0), et && ((1 & se) == 1 && se--, (1 & oe) == 1 && oe--);
|
|
9892
9892
|
const ka = (Me - se + 1) * (en - oe + 1);
|
|
9893
9893
|
ka < Ea && (Ea = ka, Tr = tn, Ft = se, qt = oe, Wt = Me - se + 1, ge = en - oe + 1);
|
|
9894
9894
|
}
|
|
9895
|
-
ae = new Uint8Array(it[at - 1 - Tr]), Tr == 1 && (
|
|
9895
|
+
ae = new Uint8Array(it[at - 1 - Tr]), Tr == 1 && (dt[at - 1].dispose = 2), Mt = new Uint8Array(Wt * ge * 4), t(ae, rt, ct, Mt, Wt, ge, -Ft, -qt, 0), Sr = t(Tt, rt, ct, Mt, Wt, ge, -Ft, -qt, 3) ? 1 : 0, Sr == 1 ? f(Tt, rt, ct, Mt, { x: Ft, y: qt, width: Wt, height: ge }) : t(Tt, rt, ct, Mt, Wt, ge, -Ft, -qt, 0);
|
|
9896
9896
|
} else Mt = Tt.slice(0);
|
|
9897
|
-
|
|
9897
|
+
dt.push({ rect: { x: Ft, y: qt, width: Wt, height: ge }, img: Mt, blend: Sr, dispose: 0 });
|
|
9898
9898
|
}
|
|
9899
|
-
if (
|
|
9900
|
-
if ((pe =
|
|
9901
|
-
const Tt = pe.rect, _t =
|
|
9902
|
-
|
|
9899
|
+
if (yt) for (at = 0; at < dt.length; at++) {
|
|
9900
|
+
if ((pe = dt[at]).blend == 1) continue;
|
|
9901
|
+
const Tt = pe.rect, _t = dt[at - 1].rect, Ft = Math.min(Tt.x, _t.x), qt = Math.min(Tt.y, _t.y), Wt = { x: Ft, y: qt, width: Math.max(Tt.x + Tt.width, _t.x + _t.width) - Ft, height: Math.max(Tt.y + Tt.height, _t.y + _t.height) - qt };
|
|
9902
|
+
dt[at - 1].dispose = 1, at - 1 != 0 && u(it, rt, ct, dt, at - 1, Wt, et), u(it, rt, ct, dt, at, Wt, et);
|
|
9903
9903
|
}
|
|
9904
9904
|
let In = 0;
|
|
9905
|
-
if (it.length != 1) for (var xt = 0; xt <
|
|
9905
|
+
if (it.length != 1) for (var xt = 0; xt < dt.length; xt++) {
|
|
9906
9906
|
var pe;
|
|
9907
|
-
In += (pe =
|
|
9907
|
+
In += (pe = dt[xt]).rect.width * pe.rect.height;
|
|
9908
9908
|
}
|
|
9909
|
-
return
|
|
9909
|
+
return dt;
|
|
9910
9910
|
})(p, y, T, F, C, O), q = {}, J = [], tt = [];
|
|
9911
9911
|
if (I != 0) {
|
|
9912
|
-
const
|
|
9913
|
-
for (B = 0; B < K.length; B++)
|
|
9914
|
-
const it = (function(
|
|
9912
|
+
const gt = [];
|
|
9913
|
+
for (B = 0; B < K.length; B++) gt.push(K[B].img.buffer);
|
|
9914
|
+
const it = (function(et) {
|
|
9915
9915
|
let It = 0;
|
|
9916
|
-
for (var
|
|
9916
|
+
for (var dt = 0; dt < et.length; dt++) It += et[dt].byteLength;
|
|
9917
9917
|
const at = new Uint8Array(It);
|
|
9918
9918
|
let Mt = 0;
|
|
9919
|
-
for (
|
|
9920
|
-
const ae = new Uint8Array(dt
|
|
9919
|
+
for (dt = 0; dt < et.length; dt++) {
|
|
9920
|
+
const ae = new Uint8Array(et[dt]), In = ae.length;
|
|
9921
9921
|
for (let xt = 0; xt < In; xt += 4) {
|
|
9922
9922
|
let pe = ae[xt], Tt = ae[xt + 1], _t = ae[xt + 2];
|
|
9923
9923
|
const Ft = ae[xt + 3];
|
|
@@ -9926,61 +9926,61 @@ const Nt = (function() {
|
|
|
9926
9926
|
Mt += In;
|
|
9927
9927
|
}
|
|
9928
9928
|
return at.buffer;
|
|
9929
|
-
})(
|
|
9930
|
-
for (B = 0; B <
|
|
9931
|
-
let
|
|
9929
|
+
})(gt), rt = b(it, I);
|
|
9930
|
+
for (B = 0; B < rt.plte.length; B++) J.push(rt.plte[B].est.rgba);
|
|
9931
|
+
let ct = 0;
|
|
9932
9932
|
for (B = 0; B < K.length; B++) {
|
|
9933
|
-
const
|
|
9934
|
-
var W = new Uint8Array(
|
|
9933
|
+
const yt = (Y = K[B]).img.length;
|
|
9934
|
+
var W = new Uint8Array(rt.inds.buffer, ct >> 2, yt >> 2);
|
|
9935
9935
|
tt.push(W);
|
|
9936
|
-
const
|
|
9937
|
-
_ && o(Y.img, Y.rect.width, Y.rect.height, J,
|
|
9936
|
+
const et = new Uint8Array(rt.abuf, ct, yt);
|
|
9937
|
+
_ && o(Y.img, Y.rect.width, Y.rect.height, J, et, W), Y.img.set(et), ct += yt;
|
|
9938
9938
|
}
|
|
9939
9939
|
} else for (N = 0; N < K.length; N++) {
|
|
9940
9940
|
var Y = K[N];
|
|
9941
|
-
const
|
|
9941
|
+
const gt = new Uint32Array(Y.img.buffer);
|
|
9942
9942
|
var H = Y.rect.width;
|
|
9943
|
-
for ($ =
|
|
9944
|
-
const it =
|
|
9945
|
-
if (B != 0 && it ==
|
|
9946
|
-
else if (B > H && it ==
|
|
9943
|
+
for ($ = gt.length, W = new Uint8Array($), tt.push(W), B = 0; B < $; B++) {
|
|
9944
|
+
const it = gt[B];
|
|
9945
|
+
if (B != 0 && it == gt[B - 1]) W[B] = W[B - 1];
|
|
9946
|
+
else if (B > H && it == gt[B - H]) W[B] = W[B - H];
|
|
9947
9947
|
else {
|
|
9948
|
-
let
|
|
9949
|
-
if (
|
|
9950
|
-
W[B] =
|
|
9948
|
+
let rt = q[it];
|
|
9949
|
+
if (rt == null && (q[it] = rt = J.length, J.push(it), J.length >= 300)) break;
|
|
9950
|
+
W[B] = rt;
|
|
9951
9951
|
}
|
|
9952
9952
|
}
|
|
9953
9953
|
}
|
|
9954
9954
|
const Z = J.length;
|
|
9955
9955
|
for (Z <= 256 && g == 0 && (U = Z <= 2 ? 1 : Z <= 4 ? 2 : Z <= 16 ? 4 : 8, U = Math.max(U, x)), N = 0; N < K.length; N++) {
|
|
9956
9956
|
(Y = K[N]).rect.x, Y.rect.y, H = Y.rect.width;
|
|
9957
|
-
const
|
|
9957
|
+
const gt = Y.rect.height;
|
|
9958
9958
|
let it = Y.img;
|
|
9959
9959
|
new Uint32Array(it.buffer);
|
|
9960
|
-
let
|
|
9960
|
+
let rt = 4 * H, ct = 4;
|
|
9961
9961
|
if (Z <= 256 && g == 0) {
|
|
9962
|
-
|
|
9963
|
-
var
|
|
9964
|
-
const
|
|
9965
|
-
for (let
|
|
9966
|
-
B =
|
|
9967
|
-
const It =
|
|
9968
|
-
if (U == 8) for (var ot = 0; ot < H; ot++)
|
|
9969
|
-
else if (U == 4) for (ot = 0; ot < H; ot++)
|
|
9970
|
-
else if (U == 2) for (ot = 0; ot < H; ot++)
|
|
9971
|
-
else if (U == 1) for (ot = 0; ot < H; ot++)
|
|
9962
|
+
rt = Math.ceil(U * H / 8);
|
|
9963
|
+
var pt = new Uint8Array(rt * gt);
|
|
9964
|
+
const yt = tt[N];
|
|
9965
|
+
for (let et = 0; et < gt; et++) {
|
|
9966
|
+
B = et * rt;
|
|
9967
|
+
const It = et * H;
|
|
9968
|
+
if (U == 8) for (var ot = 0; ot < H; ot++) pt[B + ot] = yt[It + ot];
|
|
9969
|
+
else if (U == 4) for (ot = 0; ot < H; ot++) pt[B + (ot >> 1)] |= yt[It + ot] << 4 - 4 * (1 & ot);
|
|
9970
|
+
else if (U == 2) for (ot = 0; ot < H; ot++) pt[B + (ot >> 2)] |= yt[It + ot] << 6 - 2 * (3 & ot);
|
|
9971
|
+
else if (U == 1) for (ot = 0; ot < H; ot++) pt[B + (ot >> 3)] |= yt[It + ot] << 7 - 1 * (7 & ot);
|
|
9972
9972
|
}
|
|
9973
|
-
it =
|
|
9973
|
+
it = pt, j = 3, ct = 1;
|
|
9974
9974
|
} else if (V == 0 && K.length == 1) {
|
|
9975
|
-
|
|
9976
|
-
const
|
|
9977
|
-
for (B = 0; B <
|
|
9978
|
-
const
|
|
9979
|
-
|
|
9975
|
+
pt = new Uint8Array(H * gt * 3);
|
|
9976
|
+
const yt = H * gt;
|
|
9977
|
+
for (B = 0; B < yt; B++) {
|
|
9978
|
+
const et = 3 * B, It = 4 * B;
|
|
9979
|
+
pt[et] = it[It], pt[et + 1] = it[It + 1], pt[et + 2] = it[It + 2];
|
|
9980
9980
|
}
|
|
9981
|
-
it =
|
|
9981
|
+
it = pt, j = 2, ct = 3, rt = 3 * H;
|
|
9982
9982
|
}
|
|
9983
|
-
Y.img = it, Y.bpl =
|
|
9983
|
+
Y.img = it, Y.bpl = rt, Y.bpp = ct;
|
|
9984
9984
|
}
|
|
9985
9985
|
return { ctype: j, depth: U, plte: J, frames: K };
|
|
9986
9986
|
}
|
|
@@ -11517,8 +11517,8 @@ function kv({
|
|
|
11517
11517
|
const H = await Promise.all(
|
|
11518
11518
|
Y.map(async (Z) => {
|
|
11519
11519
|
if (Z.type === "image" && Z.file) {
|
|
11520
|
-
const
|
|
11521
|
-
return { ...Z, content:
|
|
11520
|
+
const pt = await $u(Z);
|
|
11521
|
+
return { ...Z, content: pt, file: void 0 };
|
|
11522
11522
|
}
|
|
11523
11523
|
return Z;
|
|
11524
11524
|
})
|
|
@@ -11622,7 +11622,7 @@ function kv({
|
|
|
11622
11622
|
o((H) => Xu(H, W, Y));
|
|
11623
11623
|
}, C = ({ imageBlockId: W, src: Y, alt: H, caption: Z }) => {
|
|
11624
11624
|
o(
|
|
11625
|
-
(
|
|
11625
|
+
(pt) => Ku(pt, W, Y, H, Z)
|
|
11626
11626
|
);
|
|
11627
11627
|
}, O = ({ videoBlockId: W, src: Y, provider: H }) => {
|
|
11628
11628
|
o((Z) => Gu(Z, W, Y, H));
|
|
@@ -11637,8 +11637,8 @@ function kv({
|
|
|
11637
11637
|
(Y.type === "image" || Y.type === "video") && Y.data.src !== "" || o((H) => H.filter((Z) => Z.id !== W));
|
|
11638
11638
|
}, U = (W, Y) => {
|
|
11639
11639
|
o((H) => {
|
|
11640
|
-
const Z = [...H], [
|
|
11641
|
-
return Z.splice(Y, 0,
|
|
11640
|
+
const Z = [...H], [pt] = Z.splice(W, 1);
|
|
11641
|
+
return Z.splice(Y, 0, pt), Z;
|
|
11642
11642
|
});
|
|
11643
11643
|
};
|
|
11644
11644
|
return {
|
|
@@ -11848,56 +11848,58 @@ function Qv({
|
|
|
11848
11848
|
// draftify container background set
|
|
11849
11849
|
DraftifyBackground: m,
|
|
11850
11850
|
// font styling
|
|
11851
|
-
fontFamily: b = null
|
|
11851
|
+
fontFamily: b = null,
|
|
11852
|
+
// enable toolbar
|
|
11853
|
+
ToolBarEnable: w
|
|
11852
11854
|
}) {
|
|
11853
11855
|
const {
|
|
11854
11856
|
// current view
|
|
11855
|
-
view:
|
|
11856
|
-
setView:
|
|
11857
|
+
view: v,
|
|
11858
|
+
setView: k,
|
|
11857
11859
|
// background grid
|
|
11858
|
-
gridDots:
|
|
11859
|
-
setGridDots:
|
|
11860
|
+
gridDots: S,
|
|
11861
|
+
setGridDots: E,
|
|
11860
11862
|
// document metadata
|
|
11861
|
-
docTitle:
|
|
11862
|
-
setDocTitle:
|
|
11863
|
-
description:
|
|
11864
|
-
setDescription:
|
|
11865
|
-
author:
|
|
11866
|
-
setAuthor:
|
|
11863
|
+
docTitle: P,
|
|
11864
|
+
setDocTitle: A,
|
|
11865
|
+
description: L,
|
|
11866
|
+
setDescription: p,
|
|
11867
|
+
author: y,
|
|
11868
|
+
setAuthor: T,
|
|
11867
11869
|
// copy blocks
|
|
11868
|
-
handleCopy:
|
|
11870
|
+
handleCopy: I,
|
|
11869
11871
|
// prompt handlers
|
|
11870
|
-
handlePromptAction:
|
|
11871
|
-
promptAction:
|
|
11872
|
-
setPromptAction:
|
|
11873
|
-
promptVisibility:
|
|
11874
|
-
setPromptVisiblility:
|
|
11872
|
+
handlePromptAction: M,
|
|
11873
|
+
promptAction: F,
|
|
11874
|
+
setPromptAction: C,
|
|
11875
|
+
promptVisibility: O,
|
|
11876
|
+
setPromptVisiblility: x,
|
|
11875
11877
|
// block creator
|
|
11876
|
-
handleClick:
|
|
11878
|
+
handleClick: g,
|
|
11877
11879
|
// block modifiers
|
|
11878
|
-
modifyHeading:
|
|
11879
|
-
modifySubheading:
|
|
11880
|
-
modifyParagraph:
|
|
11881
|
-
modifyQuote:
|
|
11882
|
-
modifyList:
|
|
11883
|
-
modifyTable:
|
|
11884
|
-
modifyImage:
|
|
11885
|
-
modifyVideo:
|
|
11886
|
-
modifyLink:
|
|
11887
|
-
modifyCode:
|
|
11888
|
-
modifyCustom:
|
|
11880
|
+
modifyHeading: _,
|
|
11881
|
+
modifySubheading: j,
|
|
11882
|
+
modifyParagraph: U,
|
|
11883
|
+
modifyQuote: D,
|
|
11884
|
+
modifyList: N,
|
|
11885
|
+
modifyTable: $,
|
|
11886
|
+
modifyImage: B,
|
|
11887
|
+
modifyVideo: V,
|
|
11888
|
+
modifyLink: K,
|
|
11889
|
+
modifyCode: q,
|
|
11890
|
+
modifyCustom: J,
|
|
11889
11891
|
// drag and drop handlers
|
|
11890
|
-
onDropHandler:
|
|
11891
|
-
onDragStart:
|
|
11892
|
-
onDragEnd:
|
|
11893
|
-
onDragEnter:
|
|
11894
|
-
onDragLeave:
|
|
11895
|
-
containerVariants:
|
|
11896
|
-
itemVariants:
|
|
11897
|
-
transitions:
|
|
11898
|
-
whileHover:
|
|
11892
|
+
onDropHandler: tt,
|
|
11893
|
+
onDragStart: W,
|
|
11894
|
+
onDragEnd: Y,
|
|
11895
|
+
onDragEnter: H,
|
|
11896
|
+
onDragLeave: Z,
|
|
11897
|
+
containerVariants: pt,
|
|
11898
|
+
itemVariants: ot,
|
|
11899
|
+
transitions: gt,
|
|
11900
|
+
whileHover: it,
|
|
11899
11901
|
// block delete
|
|
11900
|
-
handleDelete:
|
|
11902
|
+
handleDelete: rt
|
|
11901
11903
|
} = kv({
|
|
11902
11904
|
draftifyDoc: t,
|
|
11903
11905
|
setDoc: e,
|
|
@@ -11906,8 +11908,8 @@ function Qv({
|
|
|
11906
11908
|
defaultCustomData3: u,
|
|
11907
11909
|
localStorageEnable: f
|
|
11908
11910
|
});
|
|
11909
|
-
return Iv(
|
|
11910
|
-
h && /* @__PURE__ */ R.jsx(Cv, { gridDots:
|
|
11911
|
+
return Iv(E), /* @__PURE__ */ R.jsxs("div", { className: "draftify-root", children: [
|
|
11912
|
+
h && /* @__PURE__ */ R.jsx(Cv, { gridDots: S }),
|
|
11911
11913
|
/* @__PURE__ */ R.jsxs(
|
|
11912
11914
|
"div",
|
|
11913
11915
|
{
|
|
@@ -11917,55 +11919,55 @@ function Qv({
|
|
|
11917
11919
|
},
|
|
11918
11920
|
className: "draftify-container",
|
|
11919
11921
|
children: [
|
|
11920
|
-
|
|
11922
|
+
O && /* @__PURE__ */ R.jsx(
|
|
11921
11923
|
Ev,
|
|
11922
11924
|
{
|
|
11923
|
-
docTitle:
|
|
11924
|
-
setDocTitle:
|
|
11925
|
-
description:
|
|
11926
|
-
setDescription:
|
|
11927
|
-
author:
|
|
11928
|
-
setAuthor:
|
|
11929
|
-
promptAction:
|
|
11930
|
-
handlePromptAction:
|
|
11931
|
-
setPromptVisiblility:
|
|
11925
|
+
docTitle: P,
|
|
11926
|
+
setDocTitle: A,
|
|
11927
|
+
description: L,
|
|
11928
|
+
setDescription: p,
|
|
11929
|
+
author: y,
|
|
11930
|
+
setAuthor: T,
|
|
11931
|
+
promptAction: F,
|
|
11932
|
+
handlePromptAction: M,
|
|
11933
|
+
setPromptVisiblility: x
|
|
11932
11934
|
}
|
|
11933
11935
|
),
|
|
11934
|
-
/* @__PURE__ */ R.jsx(
|
|
11936
|
+
w && /* @__PURE__ */ R.jsx(
|
|
11935
11937
|
Tv,
|
|
11936
11938
|
{
|
|
11937
|
-
view:
|
|
11938
|
-
setView:
|
|
11939
|
+
view: v,
|
|
11940
|
+
setView: k,
|
|
11939
11941
|
blocksData: t.blocks,
|
|
11940
|
-
setPromptAction:
|
|
11941
|
-
setPromptVisiblility:
|
|
11942
|
-
handleCopy:
|
|
11942
|
+
setPromptAction: C,
|
|
11943
|
+
setPromptVisiblility: x,
|
|
11944
|
+
handleCopy: I
|
|
11943
11945
|
}
|
|
11944
11946
|
),
|
|
11945
|
-
|
|
11947
|
+
v === "editor" && // Input View
|
|
11946
11948
|
/* @__PURE__ */ R.jsxs(R.Fragment, { children: [
|
|
11947
|
-
/* @__PURE__ */ R.jsx(Av, { handleClick:
|
|
11948
|
-
/* @__PURE__ */ R.jsx("div", { className: "editor-area", onSubmit: (
|
|
11949
|
+
/* @__PURE__ */ R.jsx(Av, { handleClick: g, options: n }),
|
|
11950
|
+
/* @__PURE__ */ R.jsx("div", { className: "editor-area", onSubmit: (ct) => ct.preventDefault(), children: /* @__PURE__ */ R.jsx(
|
|
11949
11951
|
Ks.div,
|
|
11950
11952
|
{
|
|
11951
11953
|
style: { display: "grid", gap: "10px" },
|
|
11952
|
-
variants:
|
|
11954
|
+
variants: pt,
|
|
11953
11955
|
animate: "show",
|
|
11954
11956
|
exit: "hidden",
|
|
11955
|
-
children: /* @__PURE__ */ R.jsx(jh, { children: t.blocks.map((
|
|
11957
|
+
children: /* @__PURE__ */ R.jsx(jh, { children: t.blocks.map((ct, yt) => /* @__PURE__ */ R.jsxs(
|
|
11956
11958
|
Ks.div,
|
|
11957
11959
|
{
|
|
11958
11960
|
layout: !0,
|
|
11959
|
-
variants:
|
|
11960
|
-
transition:
|
|
11961
|
-
whileHover:
|
|
11961
|
+
variants: ot,
|
|
11962
|
+
transition: gt,
|
|
11963
|
+
whileHover: it,
|
|
11962
11964
|
draggable: !0,
|
|
11963
|
-
onDragStart: (
|
|
11964
|
-
onDragEnd: (
|
|
11965
|
-
onDragOver: (
|
|
11966
|
-
onDragEnter: (
|
|
11967
|
-
onDragLeave: (
|
|
11968
|
-
onDrop: (
|
|
11965
|
+
onDragStart: (et) => W(et, yt),
|
|
11966
|
+
onDragEnd: (et) => Y(et),
|
|
11967
|
+
onDragOver: (et) => et.preventDefault(),
|
|
11968
|
+
onDragEnter: (et) => H(et),
|
|
11969
|
+
onDragLeave: (et) => Z(et),
|
|
11970
|
+
onDrop: (et) => tt(et, yt),
|
|
11969
11971
|
className: "block-container",
|
|
11970
11972
|
children: [
|
|
11971
11973
|
/* @__PURE__ */ R.jsx(Pv, {}),
|
|
@@ -11973,18 +11975,18 @@ function Qv({
|
|
|
11973
11975
|
wv,
|
|
11974
11976
|
{
|
|
11975
11977
|
fontFamily: b,
|
|
11976
|
-
block:
|
|
11977
|
-
modifyHeading:
|
|
11978
|
-
modifySubheading:
|
|
11979
|
-
modifyParagraph:
|
|
11980
|
-
modifyQuote:
|
|
11981
|
-
modifyList:
|
|
11982
|
-
modifyTable:
|
|
11983
|
-
modifyImage:
|
|
11984
|
-
modifyVideo:
|
|
11985
|
-
modifyLink:
|
|
11986
|
-
modifyCode:
|
|
11987
|
-
modifyCustom:
|
|
11978
|
+
block: ct,
|
|
11979
|
+
modifyHeading: _,
|
|
11980
|
+
modifySubheading: j,
|
|
11981
|
+
modifyParagraph: U,
|
|
11982
|
+
modifyQuote: D,
|
|
11983
|
+
modifyList: N,
|
|
11984
|
+
modifyTable: $,
|
|
11985
|
+
modifyImage: B,
|
|
11986
|
+
modifyVideo: V,
|
|
11987
|
+
modifyLink: K,
|
|
11988
|
+
modifyCode: q,
|
|
11989
|
+
modifyCustom: J,
|
|
11988
11990
|
CustomEditor1: r,
|
|
11989
11991
|
CustomEditor2: i,
|
|
11990
11992
|
CustomEditor3: a
|
|
@@ -11995,17 +11997,17 @@ function Qv({
|
|
|
11995
11997
|
{
|
|
11996
11998
|
icon: ["fas", "trash"],
|
|
11997
11999
|
className: "delete-icon",
|
|
11998
|
-
onClick: () =>
|
|
12000
|
+
onClick: () => rt(ct.id)
|
|
11999
12001
|
}
|
|
12000
12002
|
)
|
|
12001
12003
|
]
|
|
12002
12004
|
},
|
|
12003
|
-
|
|
12005
|
+
ct.id
|
|
12004
12006
|
)) })
|
|
12005
12007
|
}
|
|
12006
12008
|
) })
|
|
12007
12009
|
] }),
|
|
12008
|
-
|
|
12010
|
+
v === "preview" && /* @__PURE__ */ R.jsx("div", { className: "output-area", children: /* @__PURE__ */ R.jsx(
|
|
12009
12011
|
Sv,
|
|
12010
12012
|
{
|
|
12011
12013
|
fontFamily: b,
|
|
@@ -12015,7 +12017,13 @@ function Qv({
|
|
|
12015
12017
|
CustomOutput3: c
|
|
12016
12018
|
}
|
|
12017
12019
|
) }),
|
|
12018
|
-
/* @__PURE__ */ R.jsx(
|
|
12020
|
+
w && /* @__PURE__ */ R.jsx(
|
|
12021
|
+
"em",
|
|
12022
|
+
{
|
|
12023
|
+
style: { fontSize: "11px", fontWeight: "semibold", color: "blue" },
|
|
12024
|
+
children: "The document title, description and author can be added when exporting or downloading."
|
|
12025
|
+
}
|
|
12026
|
+
)
|
|
12019
12027
|
]
|
|
12020
12028
|
}
|
|
12021
12029
|
)
|