markmap-view 0.18.12 → 0.18.13
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/browser/index.js +1 -1
- package/dist/index.js +10 -10
- package/dist/types.d.ts +1 -0
- package/package.json +2 -2
package/dist/browser/index.js
CHANGED
|
@@ -395,7 +395,7 @@
|
|
|
395
395
|
const value = options[key];
|
|
396
396
|
if (typeof value === "number") derivedOptions[key] = value;
|
|
397
397
|
});
|
|
398
|
-
const booleanKeys = ["zoom", "pan"];
|
|
398
|
+
const booleanKeys = ["autoFit", "zoom", "pan"];
|
|
399
399
|
booleanKeys.forEach((key) => {
|
|
400
400
|
const value = options[key];
|
|
401
401
|
if (value != null) derivedOptions[key] = !!value;
|
package/dist/index.js
CHANGED
|
@@ -61,7 +61,7 @@ function oe(e) {
|
|
|
61
61
|
].forEach((c) => {
|
|
62
62
|
const l = i[c];
|
|
63
63
|
typeof l == "number" && (t[c] = l);
|
|
64
|
-
}), ["zoom", "pan"].forEach((c) => {
|
|
64
|
+
}), ["autoFit", "zoom", "pan"].forEach((c) => {
|
|
65
65
|
const l = i[c];
|
|
66
66
|
l != null && (t[c] = !!l);
|
|
67
67
|
}), t;
|
|
@@ -165,16 +165,16 @@ function jt() {
|
|
|
165
165
|
}
|
|
166
166
|
function j(e, t) {
|
|
167
167
|
var i = new _(e), n = +e.value && (i.value = e.value), s, o = [i], h, a, c, l;
|
|
168
|
-
for (t == null && (t =
|
|
168
|
+
for (t == null && (t = $t); s = o.pop(); )
|
|
169
169
|
if (n && (s.value = +s.data.value), (a = t(s.data)) && (l = a.length))
|
|
170
170
|
for (s.children = new Array(l), c = l - 1; c >= 0; --c)
|
|
171
171
|
o.push(h = s.children[c] = new _(a[c])), h.parent = s, h.depth = s.depth + 1;
|
|
172
172
|
return i.eachBefore(Bt);
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function Ft() {
|
|
175
175
|
return j(this).eachBefore(Nt);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function $t(e) {
|
|
178
178
|
return e.children;
|
|
179
179
|
}
|
|
180
180
|
function Nt(e) {
|
|
@@ -202,7 +202,7 @@ _.prototype = j.prototype = {
|
|
|
202
202
|
descendants: Ht,
|
|
203
203
|
leaves: Tt,
|
|
204
204
|
links: jt,
|
|
205
|
-
copy:
|
|
205
|
+
copy: Ft
|
|
206
206
|
};
|
|
207
207
|
const Lt = "2.1.2", Dt = {
|
|
208
208
|
version: Lt
|
|
@@ -614,20 +614,20 @@ class it {
|
|
|
614
614
|
let b = this.g.selectAll(v(ee)).selectAll(v("rect")).data(k ? [this._getHighlightRect(k)] : []).join("rect").attr("x", (r) => r.x).attr("y", (r) => r.y).attr("width", (r) => r.width).attr("height", (r) => r.height);
|
|
615
615
|
const z = this.g.selectAll(v(M)).each((r) => {
|
|
616
616
|
m[r.state.id] = r.state.rect;
|
|
617
|
-
}).data(d, (r) => r.state.key),
|
|
617
|
+
}).data(d, (r) => r.state.key), F = z.enter().append("g").attr("data-depth", (r) => r.state.depth).attr("data-path", (r) => r.state.path).each((r) => {
|
|
618
618
|
u(c[l[r.state.id]]);
|
|
619
619
|
}), S = z.exit().each((r) => {
|
|
620
620
|
u(c[l[r.state.id]]);
|
|
621
|
-
}), w = z.merge(
|
|
621
|
+
}), w = z.merge(F).attr(
|
|
622
622
|
"class",
|
|
623
623
|
(r) => {
|
|
624
624
|
var g;
|
|
625
625
|
return ["markmap-node", ((g = r.payload) == null ? void 0 : g.fold) && "markmap-fold"].filter(Boolean).join(" ");
|
|
626
626
|
}
|
|
627
|
-
),
|
|
627
|
+
), $ = w.selectAll(v("line")).data(
|
|
628
628
|
(r) => [r],
|
|
629
629
|
(r) => r.state.key
|
|
630
|
-
), N =
|
|
630
|
+
), N = $.enter().append("line").attr("stroke", (r) => s(r)).attr("stroke-width", 0), B = $.merge(N), L = w.selectAll(v("circle")).data(
|
|
631
631
|
(r) => {
|
|
632
632
|
var g;
|
|
633
633
|
return (g = r.children) != null && g.length ? [r] : [];
|
|
@@ -671,7 +671,7 @@ class it {
|
|
|
671
671
|
this.svg.style(
|
|
672
672
|
"--markmap-max-width",
|
|
673
673
|
o ? `${o}px` : null
|
|
674
|
-
), await new Promise(requestAnimationFrame), this._relayout(), b = b.data(k ? [this._getHighlightRect(k)] : []).join("rect"), this.transition(b).attr("x", (r) => r.x).attr("y", (r) => r.y).attr("width", (r) => r.width).attr("height", (r) => r.height),
|
|
674
|
+
), await new Promise(requestAnimationFrame), this._relayout(), b = b.data(k ? [this._getHighlightRect(k)] : []).join("rect"), this.transition(b).attr("x", (r) => r.x).attr("y", (r) => r.y).attr("width", (r) => r.width).attr("height", (r) => r.height), F.attr("transform", (r) => {
|
|
675
675
|
const g = x(r);
|
|
676
676
|
return `translate(${g.x + g.width - r.state.rect.width},${g.y + g.height - r.state.rect.height})`;
|
|
677
677
|
}), this.transition(S).attr("transform", (r) => {
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markmap-view",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.13",
|
|
4
4
|
"description": "View markmaps in browser",
|
|
5
5
|
"author": "Gerald <gera2ld@live.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"markmap-common": "*"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "8068aa34ef4af915baf8a63794fe3c7db4534c7c"
|
|
55
55
|
}
|