@linkurious/ogma-annotations 1.1.16 → 1.1.19
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 +5 -5
- package/dist/index.mjs +101 -101
- package/dist/types/index.d.ts +615 -7
- package/package.json +7 -4
- package/dist/types/Control.d.ts +0 -112
- package/dist/types/Editor/Arrows/defaults.d.ts +0 -10
- package/dist/types/Editor/Arrows/index.d.ts +0 -39
- package/dist/types/Editor/Arrows/render.d.ts +0 -13
- package/dist/types/Editor/Texts/defaults.d.ts +0 -5
- package/dist/types/Editor/Texts/index.d.ts +0 -42
- package/dist/types/Editor/Texts/render.d.ts +0 -7
- package/dist/types/Editor/base.d.ts +0 -84
- package/dist/types/constants.d.ts +0 -13
- package/dist/types/links.d.ts +0 -21
- package/dist/types/types.d.ts +0 -191
- package/dist/types/utils.d.ts +0 -56
- package/dist/types/vec.d.ts +0 -15
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ const zt = {
|
|
|
8
8
|
strokeWidth: 1,
|
|
9
9
|
head: "none",
|
|
10
10
|
tail: "none"
|
|
11
|
-
},
|
|
11
|
+
}, De = {
|
|
12
12
|
id: 0,
|
|
13
13
|
type: "Feature",
|
|
14
14
|
properties: {
|
|
@@ -55,18 +55,18 @@ const zt = {
|
|
|
55
55
|
function Pt(a) {
|
|
56
56
|
return document.createElementNS(Hn, a);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function je(a) {
|
|
59
59
|
return a.geometry.bbox || Fn(a), a.geometry.bbox;
|
|
60
60
|
}
|
|
61
61
|
function ut(a) {
|
|
62
|
-
const h =
|
|
62
|
+
const h = je(a);
|
|
63
63
|
return {
|
|
64
64
|
width: h[2] - h[0],
|
|
65
65
|
height: h[3] - h[1]
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
function ct(a) {
|
|
69
|
-
const h =
|
|
69
|
+
const h = je(a);
|
|
70
70
|
return { x: h[0], y: h[1] };
|
|
71
71
|
}
|
|
72
72
|
function Fn(a) {
|
|
@@ -96,19 +96,19 @@ function Wt(a) {
|
|
|
96
96
|
const [h, t] = a.geometry.coordinates[1];
|
|
97
97
|
return { x: h, y: t };
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function qe(a, h, t) {
|
|
100
100
|
a.geometry.coordinates[0] = [h, t];
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function Re(a, h, t) {
|
|
103
103
|
a.geometry.coordinates[1] = [h, t];
|
|
104
104
|
}
|
|
105
105
|
function Yt(a) {
|
|
106
106
|
return { start: $t(a), end: Wt(a) };
|
|
107
107
|
}
|
|
108
108
|
function At(a, h, t, r) {
|
|
109
|
-
h === "start" ?
|
|
109
|
+
h === "start" ? qe(a, t, r) : Re(a, t, r);
|
|
110
110
|
}
|
|
111
|
-
const
|
|
111
|
+
const Ve = (a) => parseInt(a.getAttribute("data-handle-id") || "-1");
|
|
112
112
|
function si(a) {
|
|
113
113
|
return Gt(a).reduce(
|
|
114
114
|
(h, t) => (h[0] = Math.min(t[0], h[0]), h[1] = Math.min(t[1], h[1]), h[2] = Math.max(t[0], h[2]), h[3] = Math.max(t[1], h[3]), h),
|
|
@@ -170,10 +170,10 @@ function ue(a, h) {
|
|
|
170
170
|
const vt = (a, h) => ({
|
|
171
171
|
x: a.x - h.x,
|
|
172
172
|
y: a.y - h.y
|
|
173
|
-
}), kt = (a) => Math.sqrt(a.x * a.x + a.y * a.y),
|
|
173
|
+
}), kt = (a) => Math.sqrt(a.x * a.x + a.y * a.y), Ue = (a) => ({
|
|
174
174
|
x: -a.x,
|
|
175
175
|
y: -a.y
|
|
176
|
-
}),
|
|
176
|
+
}), Ge = (a) => {
|
|
177
177
|
const h = kt(a);
|
|
178
178
|
return h === 0 ? { x: 0, y: 0 } : {
|
|
179
179
|
x: a.x / h,
|
|
@@ -182,7 +182,7 @@ const vt = (a, h) => ({
|
|
|
182
182
|
}, Et = (a, h) => ({
|
|
183
183
|
x: a.x + h.x,
|
|
184
184
|
y: a.y + h.y
|
|
185
|
-
}),
|
|
185
|
+
}), We = (a, h) => ({
|
|
186
186
|
x: a.x * h,
|
|
187
187
|
y: a.y * h
|
|
188
188
|
}), Ut = (a, h) => ({
|
|
@@ -197,33 +197,33 @@ const vt = (a, h) => ({
|
|
|
197
197
|
}, Rn = (a, h) => ({
|
|
198
198
|
x: a.x / h,
|
|
199
199
|
y: a.y / h
|
|
200
|
-
}),
|
|
201
|
-
function
|
|
200
|
+
}), Me = (a, h) => a.x * h.x + a.y * h.y;
|
|
201
|
+
function Ye(a, h = 5, t = 30) {
|
|
202
202
|
var d;
|
|
203
203
|
const { start: r, end: o } = Yt(a), l = vt(o, r), u = a.properties.style && a.properties.style.strokeWidth ? (d = a.properties.style) == null ? void 0 : d.strokeWidth : 0;
|
|
204
204
|
return Math.min(t, Math.max(3 * u, kt(l) * 0.1, h));
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
const o =
|
|
206
|
+
function Oe(a, h, t, r) {
|
|
207
|
+
const o = We(Ue(Ge(h)), r);
|
|
208
208
|
if (!t || t === "none")
|
|
209
209
|
return "";
|
|
210
210
|
const l = Et(a, rt(o, Math.PI / 8)), u = Et(a, rt(o, -Math.PI / 8)), d = `${a.x} ${a.y}`;
|
|
211
211
|
return `M ${l.x} ${l.y} L ${d} ${u.x} ${u.y} ${t === "arrow" ? "" : `${l.x} ${l.y}`}`;
|
|
212
212
|
}
|
|
213
213
|
function Vn(a, h, t, r, o) {
|
|
214
|
-
const { start: l, end: u } = Yt(a), { tail: d, head: g, strokeColor: f, strokeWidth: y } = a.properties.style || t, v = vt(u, l), T =
|
|
214
|
+
const { start: l, end: u } = Yt(a), { tail: d, head: g, strokeColor: f, strokeWidth: y } = a.properties.style || t, v = vt(u, l), T = Ye(a, r, o), A = Pt("path");
|
|
215
215
|
A.setAttribute("data-annotation", `${a.id}`), A.setAttribute("data-annotation-type", "arrow");
|
|
216
216
|
const b = g === "arrow-plain" || d === "arrow";
|
|
217
217
|
A.setAttribute("stroke", f || "none"), A.setAttribute("stroke-width", `${y}`), A.setAttribute("fill", b ? f || "" : "none"), A.setAttribute("stroke-linecap", "round"), A.setAttribute("stroke-linejoin", "round");
|
|
218
|
-
const C =
|
|
218
|
+
const C = Oe(l, Ue(v), d, T), E = Oe(u, v, g, T), $ = C + `M ${l.x} ${l.y} ${u.x} ${u.y}` + E;
|
|
219
219
|
A.setAttribute("d", $), h.appendChild(A);
|
|
220
220
|
}
|
|
221
221
|
const V = -1, Xt = "dragging", Zt = "dragstart", Tt = "dragend", de = "select", fe = "unselect", Un = "hover", Gn = "unhover", pe = "remove", ge = "add", Wn = "cancelDrawing", ye = "update", Yn = "link";
|
|
222
222
|
var Xn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
223
|
-
function
|
|
223
|
+
function Xe(a) {
|
|
224
224
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
225
225
|
}
|
|
226
|
-
var
|
|
226
|
+
var Ze = { exports: {} };
|
|
227
227
|
(function(a) {
|
|
228
228
|
var h = Object.prototype.hasOwnProperty, t = "~";
|
|
229
229
|
function r() {
|
|
@@ -333,10 +333,10 @@ var Ke = { exports: {} };
|
|
|
333
333
|
var y;
|
|
334
334
|
return f ? (y = t ? t + f : f, this._events[y] && u(this, y)) : (this._events = new r(), this._eventsCount = 0), this;
|
|
335
335
|
}, d.prototype.off = d.prototype.removeListener, d.prototype.addListener = d.prototype.on, d.prefixed = t, d.EventEmitter = d, a.exports = d;
|
|
336
|
-
})(
|
|
337
|
-
var Zn =
|
|
338
|
-
const
|
|
339
|
-
class
|
|
336
|
+
})(Ze);
|
|
337
|
+
var Zn = Ze.exports;
|
|
338
|
+
const Ke = /* @__PURE__ */ Xe(Zn);
|
|
339
|
+
class Je extends Ke {
|
|
340
340
|
constructor(t, r) {
|
|
341
341
|
super();
|
|
342
342
|
m(this, "ogma");
|
|
@@ -531,16 +531,16 @@ class Qe extends Je {
|
|
|
531
531
|
this.ogma.events.off(this._onClickMouseMove).off(this._onKeyUp), this.layer.destroy();
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
const
|
|
535
|
-
class Kn extends
|
|
534
|
+
const Le = "handle-line", Ce = "handle-start", Pe = "handle-end";
|
|
535
|
+
class Kn extends Je {
|
|
536
536
|
constructor(t, r = {}) {
|
|
537
537
|
super(
|
|
538
538
|
t,
|
|
539
539
|
`
|
|
540
540
|
<div class="arrow-handle">
|
|
541
|
-
<div id="${
|
|
542
|
-
<div id="${
|
|
543
|
-
<div id="${
|
|
541
|
+
<div id="${Le}" data-handle-id="0" class="handle line"></div>
|
|
542
|
+
<div id="${Ce}" data-handle-id="1" class="handle point"></div>
|
|
543
|
+
<div id="${Pe}" data-handle-id="2" class="handle point"></div>
|
|
544
544
|
</div>
|
|
545
545
|
`
|
|
546
546
|
);
|
|
@@ -548,7 +548,7 @@ class Kn extends Qe {
|
|
|
548
548
|
m(this, "draggedHandle", V);
|
|
549
549
|
m(this, "start", { x: 0, y: 0 });
|
|
550
550
|
m(this, "end", { x: 0, y: 0 });
|
|
551
|
-
m(this, "arrow", { ...
|
|
551
|
+
m(this, "arrow", { ...De });
|
|
552
552
|
m(this, "startX", 0);
|
|
553
553
|
m(this, "startY", 0);
|
|
554
554
|
m(this, "minArrowHeight", 0);
|
|
@@ -559,7 +559,7 @@ class Kn extends Qe {
|
|
|
559
559
|
if (!r)
|
|
560
560
|
return;
|
|
561
561
|
const { x: o, y: l } = ue(t, this.ogma.getContainer());
|
|
562
|
-
this.startDragging(r, o, l), this.draggedHandle =
|
|
562
|
+
this.startDragging(r, o, l), this.draggedHandle = Ve(t.target);
|
|
563
563
|
});
|
|
564
564
|
m(this, "onMouseUp", () => {
|
|
565
565
|
this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = V, this.emit(Tt, this.arrow));
|
|
@@ -569,12 +569,12 @@ class Kn extends Qe {
|
|
|
569
569
|
return;
|
|
570
570
|
const r = this.handles[this.draggedHandle], o = this.ogma.view.getAngle(), { x: l, y: u } = rt(
|
|
571
571
|
Rn(
|
|
572
|
-
{ x: t.
|
|
572
|
+
{ x: t.x - this.startX, y: t.y - this.startY },
|
|
573
573
|
this.ogma.view.getZoom()
|
|
574
574
|
),
|
|
575
575
|
o
|
|
576
|
-
), d = r.id ===
|
|
577
|
-
(d || g) &&
|
|
576
|
+
), d = r.id === Le, g = r.id === Ce, f = r.id === Pe;
|
|
577
|
+
(d || g) && qe(this.arrow, this.start.x + l, this.start.y + u), (d || f) && Re(this.arrow, this.end.x + l, this.end.y + u), this.emit(
|
|
578
578
|
Xt,
|
|
579
579
|
this.arrow,
|
|
580
580
|
d ? "line" : g ? "start" : "end"
|
|
@@ -616,8 +616,8 @@ class Kn extends Qe {
|
|
|
616
616
|
const { start: l, end: u } = Yt(o), d = vt(t, {
|
|
617
617
|
x: (l.x + u.x) / 2,
|
|
618
618
|
y: (l.y + u.y) / 2
|
|
619
|
-
}), g = vt(u, l), f = kt(g), y =
|
|
620
|
-
return Math.abs(
|
|
619
|
+
}), g = vt(u, l), f = kt(g), y = Ge(g), v = Ye(o);
|
|
620
|
+
return Math.abs(Me(y, d)) < f / 2 + r && Math.abs(Me(rt(y, Math.PI / 2), d)) < v / 2 + r;
|
|
621
621
|
});
|
|
622
622
|
}
|
|
623
623
|
refreshEditor() {
|
|
@@ -630,11 +630,11 @@ class Kn extends Qe {
|
|
|
630
630
|
const f = {
|
|
631
631
|
x: (l.x + o.x) / 2,
|
|
632
632
|
y: (l.y + o.y) / 2
|
|
633
|
-
}, y = vt(l, o), v =
|
|
633
|
+
}, y = vt(l, o), v = We(y, 1 / kt(y)), T = Math.atan2(v.y, v.x);
|
|
634
634
|
u.style.width = `${kt(y)}px`, u.style.left = `${f.x}px`, u.style.top = `${f.y}px`, u.style.transform = `translate(-50%, -50%) rotate(${T}rad)`;
|
|
635
635
|
}
|
|
636
636
|
getDefaultOptions() {
|
|
637
|
-
return
|
|
637
|
+
return De;
|
|
638
638
|
}
|
|
639
639
|
draw(t) {
|
|
640
640
|
t.innerHTML = "";
|
|
@@ -684,7 +684,7 @@ const St = {
|
|
|
684
684
|
}
|
|
685
685
|
// position: { x: 0, y: 0 },
|
|
686
686
|
// size: { width: 100, height: 50 }
|
|
687
|
-
},
|
|
687
|
+
}, $e = {
|
|
688
688
|
handleSize: 3.5,
|
|
689
689
|
placeholder: "Your text..."
|
|
690
690
|
}, Jn = (a = 0, h = 0, t = 100, r = 50, o = "", l = { ...St }) => ({
|
|
@@ -708,7 +708,7 @@ const St = {
|
|
|
708
708
|
]
|
|
709
709
|
}
|
|
710
710
|
});
|
|
711
|
-
var
|
|
711
|
+
var Qe = { exports: {} };
|
|
712
712
|
(function(a, h) {
|
|
713
713
|
(function(t, r) {
|
|
714
714
|
a.exports = r();
|
|
@@ -823,10 +823,10 @@ var tn = { exports: {} };
|
|
|
823
823
|
s = Reflect.construct(i, arguments, c);
|
|
824
824
|
} else
|
|
825
825
|
s = i.apply(this, arguments);
|
|
826
|
-
return
|
|
826
|
+
return tn(this, s);
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function tn(e, n) {
|
|
830
830
|
if (n && (W(n) === "object" || typeof n == "function"))
|
|
831
831
|
return n;
|
|
832
832
|
if (n !== void 0)
|
|
@@ -846,7 +846,7 @@ var tn = { exports: {} };
|
|
|
846
846
|
if (!(e instanceof n))
|
|
847
847
|
throw new TypeError("Cannot call a class as a function");
|
|
848
848
|
}
|
|
849
|
-
function
|
|
849
|
+
function en(e, n) {
|
|
850
850
|
for (var s = 0; s < n.length; s++) {
|
|
851
851
|
var i = n[s];
|
|
852
852
|
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (c = function(p, w) {
|
|
@@ -865,7 +865,7 @@ var tn = { exports: {} };
|
|
|
865
865
|
var c;
|
|
866
866
|
}
|
|
867
867
|
function Ft(e, n, s) {
|
|
868
|
-
return n &&
|
|
868
|
+
return n && en(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
869
869
|
}
|
|
870
870
|
var F = function() {
|
|
871
871
|
function e() {
|
|
@@ -901,13 +901,13 @@ var tn = { exports: {} };
|
|
|
901
901
|
return Ht(this, s), n.apply(this, arguments);
|
|
902
902
|
}
|
|
903
903
|
return Ft(s);
|
|
904
|
-
}(F), Qt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, nn = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/,
|
|
904
|
+
}(F), Qt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, nn = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, me = /^[\xA0\u2011\u202F\u2060\uFEFF]/, rn = /^(?:[;\xAD%?…]|,(?!\d))/, sn = /^[´±°¢£¤$¥\u2212]/;
|
|
905
905
|
function Bt(e, n) {
|
|
906
906
|
n !== !1 && (e = e.trim());
|
|
907
907
|
for (var s, i, c = [], p = e.charAt(0), w = 0, x = 1, k = e.length; x < k; x++) {
|
|
908
908
|
s = e.charAt(x), i = e.charAt(x + 1);
|
|
909
909
|
var S = Qt.test(p), M = Qt.test(s), O = M || S, I = void 0;
|
|
910
|
-
if ((sn.test(s) && !
|
|
910
|
+
if ((sn.test(s) && !me.test(p) || rn.test(p + i) && !me.test(s)) && (O = !0), p !== "-" && p !== "‐" && p !== "–" && p !== "—" || ((I = Qt.test(e.charAt(x - 2))) && !M && (O = !1), !I && nn.test(s + i) && (O = !0)), O) {
|
|
911
911
|
var L = e.slice(w, x);
|
|
912
912
|
/\u00AD$/.test(L) ? (c.push(new F(L.slice(0, -1))), c.push(new gt())) : (c.push(new F(L)), c.push(new Dt())), w = x;
|
|
913
913
|
}
|
|
@@ -915,8 +915,8 @@ var tn = { exports: {} };
|
|
|
915
915
|
}
|
|
916
916
|
return c.push(new F(e.slice(w))), c;
|
|
917
917
|
}
|
|
918
|
-
const
|
|
919
|
-
var on = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, an = /^<\/([a-zA-Z0-9]+)([^>]*)>/, ln = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, hn = /^<!--(.+?)-->/, cn = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g,
|
|
918
|
+
const ve = { nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", fnof: "ƒ", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", bull: "•", hellip: "…", prime: "′", Prime: "″", oline: "‾", frasl: "⁄", weierp: "℘", image: "ℑ", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "⊥", or: "⊦", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦", quot: '"', amp: "&", lt: "<", gt: ">", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", circ: "ˆ", tilde: "˜", ensp: " ", emsp: " ", thinsp: " ", zwnj: "", zwj: "", lrm: "", rlm: "", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", permil: "‰", lsaquo: "‹", rsaquo: "›" };
|
|
919
|
+
var on = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, an = /^<\/([a-zA-Z0-9]+)([^>]*)>/, ln = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, hn = /^<!--(.+?)-->/, cn = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, xe = { b: function(e) {
|
|
920
920
|
e.weight = "bold";
|
|
921
921
|
}, strong: function(e) {
|
|
922
922
|
e.weight = "bold";
|
|
@@ -943,13 +943,13 @@ var tn = { exports: {} };
|
|
|
943
943
|
}, sup: function(e) {
|
|
944
944
|
e.sup = !0;
|
|
945
945
|
} }, un = { div: 1, li: 1, blockquote: 2, h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, ul: 2, ol: 2, hr: 2, p: 2 };
|
|
946
|
-
function
|
|
946
|
+
function we(e) {
|
|
947
947
|
return e.replace(cn, function(n, s, i, c) {
|
|
948
948
|
if (s || i) {
|
|
949
949
|
var p = s ? 10 : 16;
|
|
950
950
|
return String.fromCharCode(parseInt(s || i, p));
|
|
951
951
|
}
|
|
952
|
-
return c in
|
|
952
|
+
return c in ve ? ve[c] : n;
|
|
953
953
|
});
|
|
954
954
|
}
|
|
955
955
|
function dn(e) {
|
|
@@ -961,7 +961,7 @@ var tn = { exports: {} };
|
|
|
961
961
|
if (e) {
|
|
962
962
|
do
|
|
963
963
|
if (n = fn.exec(e)) {
|
|
964
|
-
var i =
|
|
964
|
+
var i = we(dn(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
|
|
965
965
|
if (s[n[1]] = i, (e = e.slice(n[0].length)).length && /^\S/.test(e[0]))
|
|
966
966
|
throw new Error("Attribute error");
|
|
967
967
|
}
|
|
@@ -971,7 +971,7 @@ var tn = { exports: {} };
|
|
|
971
971
|
}
|
|
972
972
|
return s;
|
|
973
973
|
}
|
|
974
|
-
const
|
|
974
|
+
const be = { copyright: "©", textcopyright: "©", dag: "†", textdagger: "†", ddag: "‡", textdaggerdbl: "‡", guillemotleft: "«", guillemotright: "»", guilsinglleft: "‹", guilsinglright: "›", ldots: "…", dots: "…", textellipsis: "…", lq: "‘", P: "¶", textparagraph: "¶", pounds: "£", textsterling: "£", quotedblbase: "„", quotesinglbase: "‚", rq: "’", S: "§", sim: "~", textasciicircum: "^", textasciitilde: "˜", texttildelow: "~", textasteriskcentered: "*", textbackslash: "'", textbar: "|", textbardbl: "╎", textbigcircle: "◯", textbraceleft: "{", textbraceright: "}", textbullet: "•", textdollar: "$", textemdash: "—", textendash: "—", texteuro: "€", eurosym: "€", euro: "€", textexclamdown: "¡", textgreater: ">", textless: "<", textordfeminine: "ª", textordmasculine: "º", textperiodcentered: "·", cdot: "·", textquestiondown: "¿", textquotedblleft: "“", textquotedblright: "”", textquoteleft: "‘", textquoteright: "’", textquotestraightbase: "‚", textquotestraightdblbase: "„", textregistered: "®", textthreequartersemdash: "-", texttrademark: "™", texttwelveudash: "-", textunderscore: "_", textvisiblespace: "␣", gets: "←", textleftarrow: "←", to: "→", textrightarrow: "→", textdegree: "°", infty: "∞", triangle: "△", triangledown: "▽", blacktriangle: "▲", blacktriangledown: "▼", angle: "∠", sphericalangle: "∢", aleph: "ℵ", hbar: "ħ", imath: "𝚤", jmath: "𝚥", ell: "ℓ", wp: "℘", Re: "ℜ", Im: "ℑ", mho: "℧", prime: "′", emptyset: "∅", nabla: "∇", surd: "√", partial: "∂", top: "⟙", bot: "⟂", vdash: "⟝", dashv: "⟞", forall: "∀", exists: "∃", nexists: "∄", neg: "¬", lnot: "¬", flat: "♭", natural: "♮", sharp: "♯", backslash: "\\", Box: "□", Diamond: "♢", clubsuit: "♣", diamondsuit: "♦", heartsuit: "♥", spadesuit: "♠", Join: "⨝", blacksquare: "■", bigstar: "★", diagdown: "╲", diagup: "╱", blacklozenge: "⧫", rfloor: "⌋", lfloor: "⌊", rceil: "⌉", lceil: "⌈", rangle: "⟩", langle: "⟨", sum: "∑", int: "∫", oint: "∮", prod: "∏", coprod: "∏", bigcap: "∩", bigcup: "∪", bigsqcup: "⊔", bigvee: "∨", bigwedge: "∧", bigodot: "⊙", bigotimes: "⊗", bigoplus: "⊕", biguplus: "⊎", alpha: "α", beta: "β", chi: "χ", delta: "δ", epsilon: "ε", eta: "η", gamma: "γ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", omega: "ω", phi: "φ", pi: "π", psi: "ψ", rho: "ρ", sigma: "σ", tau: "τ", theta: "θ", upsilon: "υ", xi: "ξ", zeta: "ζ", Alpha: "Α", Beta: "Β", Chi: "Χ", Delta: "Δ", Epsilon: "Ε", Eta: "Η", Gamma: "Γ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Omega: "Ω", Phi: "Φ", Pi: "Π", Psi: "Ψ", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Theta: "Θ", Upsilon: "Υ", Xi: "Ξ", Zeta: "Ζ", aa: "å", AA: "Å", ae: "æ", AE: "Æ", dh: "ð", DH: "Ð", dj: "đ", DJ: "Đ", ij: "ij", IJ: "IJ", l: "ł", L: "Ł", ng: "ŋ", NG: "Ŋ", o: "ø", O: "Ø", oe: "œ", OE: "Œ", ss: "ß", SS: "SS", th: "þ", TH: "Þ" };
|
|
975
975
|
var gn = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, yn = /^%[^\n]+(?:\n|$)/, mn = /^[^#$%&~_^\\{}]+/, vn = /^\\([&{}$%#_])/, xn = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, wn = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, U = { bf: function(e) {
|
|
976
976
|
e.weight = "bold";
|
|
977
977
|
}, it: function(e) {
|
|
@@ -1000,7 +1000,7 @@ var tn = { exports: {} };
|
|
|
1000
1000
|
var s = n;
|
|
1001
1001
|
return (e.style || e.weight || e.baseline || e.color || e.size || e.family) && (s = b(n, e)), s;
|
|
1002
1002
|
}
|
|
1003
|
-
function
|
|
1003
|
+
function Ae(e, n, s) {
|
|
1004
1004
|
for (var i, c, p = e.width; p + s.width > n && e.length; )
|
|
1005
1005
|
c = (i = e[e.length - 1]).width, i.width > s.width ? (i.value = i.value.slice(0, -1), i.width = G(i, i.font), p += i.width) : e.pop(), p -= c;
|
|
1006
1006
|
e[e.length - 1] instanceof gt && e.pop(), i = e[e.length - 1] || i || {}, s.font = b(s.font, i.bold, i.italic, ""), s.href = e.length ? i.href : null, s.rel = e.length ? i.rel : null, s.target = e.length ? i.target : null, e.push(s);
|
|
@@ -1008,7 +1008,7 @@ var tn = { exports: {} };
|
|
|
1008
1008
|
function xt(e) {
|
|
1009
1009
|
return Math.round(1e6 * e) / 1e6;
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function Ee(e) {
|
|
1012
1012
|
return function(n) {
|
|
1013
1013
|
if (Array.isArray(n))
|
|
1014
1014
|
return te(n);
|
|
@@ -1061,10 +1061,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1061
1061
|
R.whitespace && wt++, Lt += R.width, X && !R.tracking && !ot && ee(Z.id, at) && ee(R.class, dt) && ee(ht, R.href) ? q += R.value : (D(), q = R.value, Y = { fontFamily: Z.family !== p ? Z.family : null, fontSize: Z.size !== c ? Z.size : null, fontWeight: Z.weight || null, fontStyle: Z.style || null, fontVariant: Z.variant !== "normal" && Z.variant || null, fill: Z.color || null, baselineShift: Z.baseline ? 100 * Z.baseline + "%" : null, className: R.class || null }, ot && (Y.dx = xt(ot), ot = 0), R.tracking && (ot = Z.size * R.tracking), R.href && !ht ? (ht = R.href, Q = "a", Y.href = ht, Y.rel = R.rel, Y.target = R.target) : ht = null, at = Z.id, dt = R.class);
|
|
1062
1062
|
}
|
|
1063
1063
|
if (D(), I)
|
|
1064
|
-
s.push.apply(s,
|
|
1064
|
+
s.push.apply(s, Ee(H));
|
|
1065
1065
|
else {
|
|
1066
1066
|
var qt = null, Ct = nt === tt - 1 || lt[lt.length - 1] instanceof et;
|
|
1067
|
-
P && lt.length > 1 && !Ct && (qt = xt((O - Lt) / wt)), s.push(x.apply(void 0, ["tspan", { wordSpacing: qt, x: L(nt) + j, dy: xt(nt ? B : J) + "em" }].concat(
|
|
1067
|
+
P && lt.length > 1 && !Ct && (qt = xt((O - Lt) / wt)), s.push(x.apply(void 0, ["tspan", { wordSpacing: qt, x: L(nt) + j, dy: xt(nt ? B : J) + "em" }].concat(Ee(H))));
|
|
1068
1068
|
}
|
|
1069
1069
|
} else
|
|
1070
1070
|
s.push(x("tspan", { x: L(nt), dy: xt(nt ? B : J) + "em" }, " "));
|
|
@@ -1111,7 +1111,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1111
1111
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
1112
1112
|
}, ne(e);
|
|
1113
1113
|
}
|
|
1114
|
-
function
|
|
1114
|
+
function ke(e) {
|
|
1115
1115
|
for (var n = {}, s = 0; s < e.length; s++) {
|
|
1116
1116
|
var i = e[s];
|
|
1117
1117
|
typeof i != "number" && i != null && (typeof i == "string" ? n.text = i : typeof i == "function" ? n.fn = i : ne(i) === "object" && i._groups ? n.d3 = i : i && i.nodeType && i.getContext ? n.ctx = i.getContext("2d") : i && i.fillText && i.beginPath ? n.ctx = i : i && (n.text = i));
|
|
@@ -1221,14 +1221,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1221
1221
|
var mt = I(K);
|
|
1222
1222
|
if (yt.width > mt) {
|
|
1223
1223
|
var ft = new F(jt);
|
|
1224
|
-
ft.font = M, ft.width = G(jt, J),
|
|
1224
|
+
ft.font = M, ft.width = G(jt, J), Ae(yt, mt, ft), X.hasLineOverflow = !0;
|
|
1225
1225
|
}
|
|
1226
1226
|
});
|
|
1227
1227
|
}
|
|
1228
1228
|
var R = S.overflow() === "ellipsis" ? "…" : S.overflow();
|
|
1229
1229
|
if (R && P !== k.length) {
|
|
1230
1230
|
var Z = I(X.length - 1), qt = X[X.length - 1], Ct = new F(R);
|
|
1231
|
-
Ct.font = M, Ct.width = G(R, J),
|
|
1231
|
+
Ct.font = M, Ct.width = G(R, J), Ae(qt, Z, Ct), X.hasOverflow = !0;
|
|
1232
1232
|
} else
|
|
1233
1233
|
X.hasOverflow = !1;
|
|
1234
1234
|
return X.font = M, X.width = ht, X;
|
|
@@ -1273,7 +1273,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1273
1273
|
} }, { key: "createElement", value: function(i) {
|
|
1274
1274
|
return arguments.length ? (this.props.createElement = i, this) : this.props.createElement || e.createElement;
|
|
1275
1275
|
} }, { key: "render", value: function() {
|
|
1276
|
-
var i =
|
|
1276
|
+
var i = ke(arguments);
|
|
1277
1277
|
return typeof i.text == "string" && (i.text = this.linebreak(i.text)), i.ctx ? _n(i.text, this, i.ctx) : Sn(i.text, this);
|
|
1278
1278
|
} }], s && In(n.prototype, s), Object.defineProperty(n, "prototype", { writable: !1 }), e;
|
|
1279
1279
|
}();
|
|
@@ -1308,11 +1308,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1308
1308
|
}
|
|
1309
1309
|
var c;
|
|
1310
1310
|
}
|
|
1311
|
-
var
|
|
1311
|
+
var Se = function(e) {
|
|
1312
1312
|
return typeof e == "function" ? e : function() {
|
|
1313
1313
|
return e;
|
|
1314
1314
|
};
|
|
1315
|
-
},
|
|
1315
|
+
}, Te = function() {
|
|
1316
1316
|
function e(i) {
|
|
1317
1317
|
if (function(p, w) {
|
|
1318
1318
|
if (!(p instanceof w))
|
|
@@ -1339,9 +1339,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1339
1339
|
}
|
|
1340
1340
|
return this;
|
|
1341
1341
|
} }, { key: "width", value: function(i) {
|
|
1342
|
-
return arguments.length ? (this.props.width =
|
|
1342
|
+
return arguments.length ? (this.props.width = Se(i), this) : this.props.width;
|
|
1343
1343
|
} }, { key: "height", value: function(i) {
|
|
1344
|
-
return arguments.length ? (this.props.height =
|
|
1344
|
+
return arguments.length ? (this.props.height = Se(i), this) : this.props.height;
|
|
1345
1345
|
} }, { key: "rotate", value: function(i) {
|
|
1346
1346
|
return arguments.length ? (this.props.rotation = i, this) : this.props.rotation;
|
|
1347
1347
|
} }, { key: "createElement", value: function(i) {
|
|
@@ -1366,7 +1366,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1366
1366
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1367
1367
|
}()), c(w), w.restore(), w;
|
|
1368
1368
|
} }, { key: "render", value: function() {
|
|
1369
|
-
var i =
|
|
1369
|
+
var i = ke(arguments);
|
|
1370
1370
|
if (i.d3)
|
|
1371
1371
|
return i.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
|
|
1372
1372
|
if (i.ctx)
|
|
@@ -1382,14 +1382,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1382
1382
|
return s + "-" + i.toLowerCase();
|
|
1383
1383
|
})), se[e];
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1385
|
+
function _e(e, n) {
|
|
1386
1386
|
if (Array.isArray(n))
|
|
1387
1387
|
return n.forEach(function(s) {
|
|
1388
|
-
return
|
|
1388
|
+
return _e(e, s);
|
|
1389
1389
|
});
|
|
1390
1390
|
typeof n == "string" && (n = document.createTextNode(n)), e.appendChild(n);
|
|
1391
1391
|
}
|
|
1392
|
-
function
|
|
1392
|
+
function Ie(e, n) {
|
|
1393
1393
|
if (typeof document < "u") {
|
|
1394
1394
|
var s = typeof e == "string" ? document.createElementNS("http://www.w3.org/2000/svg", e) : e;
|
|
1395
1395
|
if (n && s.setAttribute)
|
|
@@ -1398,11 +1398,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1398
1398
|
for (var c = arguments.length, p = new Array(c > 2 ? c - 2 : 0), w = 2; w < c; w++)
|
|
1399
1399
|
p[w - 2] = arguments[w];
|
|
1400
1400
|
return p != null && p.length && p.forEach(function(x) {
|
|
1401
|
-
|
|
1401
|
+
_e(s, x);
|
|
1402
1402
|
}), s;
|
|
1403
1403
|
}
|
|
1404
1404
|
}
|
|
1405
|
-
it.createElement =
|
|
1405
|
+
it.createElement = Ie, it.textparser = Bt, it.defaultparser = Bt, it.htmlparser = function(e) {
|
|
1406
1406
|
e = String(e || "").trim();
|
|
1407
1407
|
for (var n, s, i = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, c = [], p = [], w = function(O) {
|
|
1408
1408
|
for (var I in i)
|
|
@@ -1420,13 +1420,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1420
1420
|
}
|
|
1421
1421
|
}; e.length; ) {
|
|
1422
1422
|
if (n = /^[^<]+/.exec(e))
|
|
1423
|
-
Bt(
|
|
1423
|
+
Bt(we(n[0]), !1).forEach(w);
|
|
1424
1424
|
else if (!(n = hn.exec(e)))
|
|
1425
1425
|
if (n = an.exec(e))
|
|
1426
1426
|
p.length && (i = p.pop()), x(n[1]);
|
|
1427
1427
|
else if (n = ln.exec(e)) {
|
|
1428
1428
|
var k = n[1];
|
|
1429
|
-
x(k), p.push(i), i = Object.create(i),
|
|
1429
|
+
x(k), p.push(i), i = Object.create(i), xe[k] && xe[k](i, "");
|
|
1430
1430
|
var S = pn(n[2]);
|
|
1431
1431
|
k === "a" && (S.href && (i.href = S.href), S.rel && (i.rel = S.rel), S.target && (i.target = S.target)), S.class && (i.class = i.class ? i.class + " " + S.class : S.class), S.style && (s = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(S.style)) && s[1] && (i.color = s[1]), k === "br" && c.push(new et());
|
|
1432
1432
|
} else
|
|
@@ -1483,8 +1483,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1483
1483
|
x(), i.family = "serif";
|
|
1484
1484
|
var I = void 0;
|
|
1485
1485
|
M === "LaTeX" && ((I = w(new F("L"))).tracking = -0.25, (I = w(new F("A"))).size = 0.7, I.baseline = 0.3, I.tracking = -0.1), (I = w(new F("T"))).tracking = -0.17, (I = w(new F("E"))).baseline = -0.22, I.tracking = -0.13, I = w(new F("X")), k();
|
|
1486
|
-
} else if (M in
|
|
1487
|
-
w(new F(
|
|
1486
|
+
} else if (M in be)
|
|
1487
|
+
w(new F(be[M])), O && x();
|
|
1488
1488
|
else if (M in U) {
|
|
1489
1489
|
var L = [], B = U[M].length - 1, J = void 0;
|
|
1490
1490
|
if (B) {
|
|
@@ -1506,13 +1506,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1506
1506
|
return c;
|
|
1507
1507
|
}, it.measureText = function(e, n, s) {
|
|
1508
1508
|
return G(e, b(n), s);
|
|
1509
|
-
}, it.Token = F, it.Break = Dt, it.LineBreak = et, it.SoftHyphen = gt, it.Rotator =
|
|
1509
|
+
}, it.Token = F, it.Break = Dt, it.LineBreak = et, it.SoftHyphen = gt, it.Rotator = Te, Te.createElement = Ie;
|
|
1510
1510
|
const Cn = it;
|
|
1511
1511
|
return r.default;
|
|
1512
1512
|
})());
|
|
1513
|
-
})(
|
|
1514
|
-
var Qn =
|
|
1515
|
-
const
|
|
1513
|
+
})(Qe);
|
|
1514
|
+
var Qn = Qe.exports;
|
|
1515
|
+
const ze = /* @__PURE__ */ Xe(Qn);
|
|
1516
1516
|
function he(a) {
|
|
1517
1517
|
return a.replace(/…$/, "");
|
|
1518
1518
|
}
|
|
@@ -1523,7 +1523,7 @@ function ti(a, h) {
|
|
|
1523
1523
|
const t = ut(a), { fontSize: r, font: o, padding: l = 0 } = a.properties.style || {};
|
|
1524
1524
|
if (t.width === t.height && t.width === 0)
|
|
1525
1525
|
return;
|
|
1526
|
-
const u = new
|
|
1526
|
+
const u = new ze({
|
|
1527
1527
|
font: `${r}px/${r}px ${o}`.replace(/(px)+/g, "px"),
|
|
1528
1528
|
width: t.width - l * 2,
|
|
1529
1529
|
height: t.height - l * 2,
|
|
@@ -1532,7 +1532,7 @@ function ti(a, h) {
|
|
|
1532
1532
|
x: 0,
|
|
1533
1533
|
overflow: "ellipsis",
|
|
1534
1534
|
parser: "html",
|
|
1535
|
-
createElement:
|
|
1535
|
+
createElement: ze.createElement
|
|
1536
1536
|
});
|
|
1537
1537
|
u.overflowWrap("break-word");
|
|
1538
1538
|
const g = u.linebreak(
|
|
@@ -1574,8 +1574,8 @@ function ti(a, h) {
|
|
|
1574
1574
|
});
|
|
1575
1575
|
}), h.appendChild(g);
|
|
1576
1576
|
}
|
|
1577
|
-
const
|
|
1578
|
-
class ei extends
|
|
1577
|
+
const Ne = 20;
|
|
1578
|
+
class ei extends Je {
|
|
1579
1579
|
constructor(t, r = {}) {
|
|
1580
1580
|
super(
|
|
1581
1581
|
t,
|
|
@@ -1628,7 +1628,7 @@ class ei extends Qe {
|
|
|
1628
1628
|
return;
|
|
1629
1629
|
this.selectedId !== r.id && this.select(this.hoveredId);
|
|
1630
1630
|
const { x: o, y: l } = ue(t, this.ogma.getContainer());
|
|
1631
|
-
this.startDragging(r, o, l), this.draggedHandle =
|
|
1631
|
+
this.startDragging(r, o, l), this.draggedHandle = Ve(t.target);
|
|
1632
1632
|
});
|
|
1633
1633
|
m(this, "onMouseMove", (t) => {
|
|
1634
1634
|
requestAnimationFrame(() => this._onMouseMove(t));
|
|
@@ -1644,10 +1644,10 @@ class ei extends Qe {
|
|
|
1644
1644
|
(d && l || o && u) && (C.y = 0, C.x = 0);
|
|
1645
1645
|
const E = l || g ? this.rect.x + C.x : this.rect.x, $ = o || g ? this.rect.y + C.y : this.rect.y, N = Math.max(
|
|
1646
1646
|
this.rect.width + T * (g || l ? 0 : 1),
|
|
1647
|
-
|
|
1647
|
+
Ne
|
|
1648
1648
|
), _ = Math.max(
|
|
1649
1649
|
this.rect.height + A * (g || o ? 0 : 1),
|
|
1650
|
-
|
|
1650
|
+
Ne
|
|
1651
1651
|
);
|
|
1652
1652
|
Bn(this.annotation, E, $, N, _), this.emit(Xt, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
|
|
1653
1653
|
});
|
|
@@ -1665,7 +1665,7 @@ class ei extends Qe {
|
|
|
1665
1665
|
const t = this.getById(this.selectedId);
|
|
1666
1666
|
t && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), t.properties.content = this.textArea.value, this.emit(ye, t), this.layer.refresh());
|
|
1667
1667
|
});
|
|
1668
|
-
this.showeditorOnHover = !1, this.handleSize =
|
|
1668
|
+
this.showeditorOnHover = !1, this.handleSize = $e.handleSize || r.textHandleSize, this.placeholder = $e.placeholder || r.textPlaceholder || "";
|
|
1669
1669
|
const o = this.textArea = this.editor.element.querySelector("textarea");
|
|
1670
1670
|
o.addEventListener("input", this._onInput), o.addEventListener("focus", this._onFocus), o.addEventListener("blur", this._onBlur), o.addEventListener("mousedown", this._onMousedown), o.spellcheck = !1, this.handles = Array.prototype.slice.call(
|
|
1671
1671
|
this.editor.element.querySelectorAll(".annotation-text-handle > .handle")
|
|
@@ -1798,7 +1798,7 @@ class ni {
|
|
|
1798
1798
|
Object.values(this.links).forEach(h);
|
|
1799
1799
|
}
|
|
1800
1800
|
}
|
|
1801
|
-
const st = (a) => a.properties.type === "arrow", pt = (a) => a.properties.type === "text",
|
|
1801
|
+
const st = (a) => a.properties.type === "arrow", pt = (a) => a.properties.type === "text", He = (a) => a.type === "FeatureCollection", ii = {
|
|
1802
1802
|
magnetColor: "#3e8",
|
|
1803
1803
|
detectMargin: 20,
|
|
1804
1804
|
magnetHandleRadius: 5,
|
|
@@ -1808,7 +1808,7 @@ const st = (a) => a.properties.type === "arrow", pt = (a) => a.properties.type =
|
|
|
1808
1808
|
textHandleSize: 3.5,
|
|
1809
1809
|
minArrowHeight: 20,
|
|
1810
1810
|
maxArrowHeight: 30
|
|
1811
|
-
},
|
|
1811
|
+
}, Fe = ["start", "end"], Be = [
|
|
1812
1812
|
{ x: 0, y: 0 },
|
|
1813
1813
|
{ x: 0.5, y: 0 },
|
|
1814
1814
|
{ x: 1, y: 0 },
|
|
@@ -1818,7 +1818,7 @@ const st = (a) => a.properties.type === "arrow", pt = (a) => a.properties.type =
|
|
|
1818
1818
|
{ x: 0.5, y: 1 },
|
|
1819
1819
|
{ x: 1, y: 1 }
|
|
1820
1820
|
];
|
|
1821
|
-
class oi extends
|
|
1821
|
+
class oi extends Ke {
|
|
1822
1822
|
constructor(t, r = {}) {
|
|
1823
1823
|
super();
|
|
1824
1824
|
m(this, "arrows");
|
|
@@ -1839,7 +1839,7 @@ class oi extends Je {
|
|
|
1839
1839
|
return;
|
|
1840
1840
|
t.beginPath(), t.fillStyle = "green";
|
|
1841
1841
|
const r = this.ogma.view.getZoom();
|
|
1842
|
-
|
|
1842
|
+
Be.forEach((o) => {
|
|
1843
1843
|
if (!this.textToMagnet)
|
|
1844
1844
|
return;
|
|
1845
1845
|
const l = ut(this.textToMagnet), u = ct(this.textToMagnet), d = Ut(o, { x: l.width, y: l.height }), g = rt(d, this.ogma.view.getAngle()), { x: f, y } = Et(g, u);
|
|
@@ -1864,7 +1864,7 @@ class oi extends Je {
|
|
|
1864
1864
|
this.layer.refresh(), this.emit(Xt, t, r);
|
|
1865
1865
|
});
|
|
1866
1866
|
m(this, "_onFeatureDragEnd", (t) => {
|
|
1867
|
-
this.dragged !== null && st(t) && $t(this.dragged) &&
|
|
1867
|
+
this.dragged !== null && st(t) && $t(this.dragged) && Fe.forEach((r) => {
|
|
1868
1868
|
this.links.getArrowLink(t.id, r) && this.emit(Yn, {
|
|
1869
1869
|
arrow: t,
|
|
1870
1870
|
link: this.links.getArrowLink(t.id, r)
|
|
@@ -1944,7 +1944,7 @@ class oi extends Je {
|
|
|
1944
1944
|
if (this.links.remove(t, r), !l)
|
|
1945
1945
|
return !1;
|
|
1946
1946
|
this.textToMagnet = l;
|
|
1947
|
-
const u = this.findMagnetPoint(
|
|
1947
|
+
const u = this.findMagnetPoint(Be, l, o);
|
|
1948
1948
|
return u ? (At(t, r, u.point.x, u.point.y), this.links.add(t, r, l.id, "text", u.magnet), !0) : !1;
|
|
1949
1949
|
}
|
|
1950
1950
|
_findAndSnapToNode(t, r, o) {
|
|
@@ -2030,7 +2030,7 @@ class oi extends Je {
|
|
|
2030
2030
|
* @param annotation The annotation to add
|
|
2031
2031
|
*/
|
|
2032
2032
|
add(t) {
|
|
2033
|
-
if (
|
|
2033
|
+
if (He(t)) {
|
|
2034
2034
|
const [r, o] = t.features.reduce(
|
|
2035
2035
|
(l, u) => (st(u) ? l[1].push(u) : pt(u) && l[0].push(u), l),
|
|
2036
2036
|
[[], []]
|
|
@@ -2052,13 +2052,13 @@ class oi extends Je {
|
|
|
2052
2052
|
* @param annotation The annotation(s) to remove
|
|
2053
2053
|
*/
|
|
2054
2054
|
remove(t) {
|
|
2055
|
-
return
|
|
2055
|
+
return He(t) ? (t.features.forEach(
|
|
2056
2056
|
(r) => this.remove(r)
|
|
2057
2057
|
), this) : (st(t) ? (this.links.remove(t, "start"), this.links.remove(t, "end"), this.arrows.remove(t.id)) : this.texts.remove(t.id), this);
|
|
2058
2058
|
}
|
|
2059
2059
|
loadLink(t) {
|
|
2060
2060
|
if (t.properties.link)
|
|
2061
|
-
for (const r of
|
|
2061
|
+
for (const r of Fe) {
|
|
2062
2062
|
const o = t.properties.link[r];
|
|
2063
2063
|
if (!o)
|
|
2064
2064
|
continue;
|
|
@@ -2164,9 +2164,9 @@ export {
|
|
|
2164
2164
|
Nn as createArrow,
|
|
2165
2165
|
Pt as createSVGElement,
|
|
2166
2166
|
Jn as createText,
|
|
2167
|
-
|
|
2167
|
+
De as defaultArrowOptions,
|
|
2168
2168
|
zt as defaultArrowStyle,
|
|
2169
|
-
|
|
2169
|
+
$e as defaultControllerOptions,
|
|
2170
2170
|
le as defaultTextOptions,
|
|
2171
2171
|
St as defaultTextStyle,
|
|
2172
2172
|
si as getAnnotationsBounds,
|
|
@@ -2175,17 +2175,17 @@ export {
|
|
|
2175
2175
|
Rt as getArrowSide,
|
|
2176
2176
|
$t as getArrowStart,
|
|
2177
2177
|
Vt as getAttachmentPointOnNode,
|
|
2178
|
-
|
|
2179
|
-
|
|
2178
|
+
Ve as getHandleId,
|
|
2179
|
+
je as getTextBbox,
|
|
2180
2180
|
ct as getTextPosition,
|
|
2181
2181
|
ut as getTextSize,
|
|
2182
|
-
|
|
2182
|
+
He as isAnnotationCollection,
|
|
2183
2183
|
st as isArrow,
|
|
2184
2184
|
pt as isText,
|
|
2185
2185
|
qn as scaleGeometry,
|
|
2186
|
-
|
|
2186
|
+
Re as setArrowEnd,
|
|
2187
2187
|
At as setArrowEndPoint,
|
|
2188
|
-
|
|
2188
|
+
qe as setArrowStart,
|
|
2189
2189
|
Bn as setTextBbox,
|
|
2190
2190
|
Fn as updateTextBbox
|
|
2191
2191
|
};
|