magic-json-tree
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -12,3 +12,3 @@ function b() { | ||
} | ||
function x(e) { | ||
function $(e) { | ||
return typeof e == "function"; | ||
@@ -22,9 +22,9 @@ } | ||
} | ||
function D(e, t) { | ||
function N(e, t) { | ||
e.appendChild(t); | ||
} | ||
function h(e, t, n) { | ||
function g(e, t, n) { | ||
e.insertBefore(t, n || null); | ||
} | ||
function y(e) { | ||
function h(e) { | ||
e.parentNode && e.parentNode.removeChild(e); | ||
@@ -39,10 +39,10 @@ } | ||
} | ||
function S(e) { | ||
function j(e) { | ||
return document.createTextNode(e); | ||
} | ||
function ce() { | ||
return S(" "); | ||
return j(" "); | ||
} | ||
function _e() { | ||
return S(""); | ||
return j(""); | ||
} | ||
@@ -58,6 +58,6 @@ function be(e, t, n, r) { | ||
} | ||
function G(e, t) { | ||
function W(e, t) { | ||
t = "" + t, e.data !== t && (e.data = t); | ||
} | ||
function R(e, t, n) { | ||
function Q(e, t, n) { | ||
e.classList[n ? "add" : "remove"](t); | ||
@@ -74,5 +74,5 @@ } | ||
function Se() { | ||
Z || (Z = !0, Ae.then(de)); | ||
Z || (Z = !0, Ae.then(ye)); | ||
} | ||
function $(e) { | ||
function x(e) { | ||
T.push(e); | ||
@@ -82,3 +82,3 @@ } | ||
let V = 0; | ||
function de() { | ||
function ye() { | ||
if (V !== 0) | ||
@@ -112,3 +112,3 @@ return; | ||
const t = e.dirty; | ||
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach($); | ||
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(x); | ||
} | ||
@@ -120,5 +120,5 @@ } | ||
} | ||
const Q = /* @__PURE__ */ new Set(); | ||
const J = /* @__PURE__ */ new Set(); | ||
let w; | ||
function I() { | ||
function O() { | ||
w = { | ||
@@ -130,14 +130,14 @@ r: 0, | ||
} | ||
function O() { | ||
function F() { | ||
w.r || P(w.c), w = w.p; | ||
} | ||
function _(e, t) { | ||
e && e.i && (Q.delete(e), e.i(t)); | ||
e && e.i && (J.delete(e), e.i(t)); | ||
} | ||
function d(e, t, n, r) { | ||
function y(e, t, n, r) { | ||
if (e && e.o) { | ||
if (Q.has(e)) | ||
if (J.has(e)) | ||
return; | ||
Q.add(e), w.c.push(() => { | ||
Q.delete(e), r && (n && e.d(1), r()); | ||
J.add(e), w.c.push(() => { | ||
J.delete(e), r && (n && e.d(1), r()); | ||
}), e.o(t); | ||
@@ -147,11 +147,11 @@ } else | ||
} | ||
function j(e) { | ||
function S(e) { | ||
e && e.c(); | ||
} | ||
function p(e, t, n, r) { | ||
const { fragment: l, after_update: u } = e.$$; | ||
l && l.m(t, n), r || $(() => { | ||
const f = e.$$.on_mount.map(se).filter(x); | ||
e.$$.on_destroy ? e.$$.on_destroy.push(...f) : P(f), e.$$.on_mount = []; | ||
}), u.forEach($); | ||
const { fragment: f, after_update: u } = e.$$; | ||
f && f.m(t, n), r || x(() => { | ||
const l = e.$$.on_mount.map(se).filter($); | ||
e.$$.on_destroy ? e.$$.on_destroy.push(...l) : P(l), e.$$.on_mount = []; | ||
}), u.forEach(x); | ||
} | ||
@@ -165,3 +165,3 @@ function A(e, t) { | ||
} | ||
function H(e, t, n, r, l, u, f, i = [-1]) { | ||
function G(e, t, n, r, f, u, l, i = [-1]) { | ||
const a = ee; | ||
@@ -174,3 +174,3 @@ M(e); | ||
update: b, | ||
not_equal: l, | ||
not_equal: f, | ||
bound: te(), | ||
@@ -188,18 +188,18 @@ on_mount: [], | ||
}; | ||
f && f(o.root); | ||
l && l(o.root); | ||
let s = !1; | ||
if (o.ctx = n ? n(e, t.props || {}, (c, g, ...E) => { | ||
const K = E.length ? E[0] : g; | ||
return o.ctx && l(o.ctx[c], o.ctx[c] = K) && (!o.skip_bound && o.bound[c] && o.bound[c](K), s && Ee(e, c)), g; | ||
if (o.ctx = n ? n(e, t.props || {}, (c, d, ...E) => { | ||
const K = E.length ? E[0] : d; | ||
return o.ctx && f(o.ctx[c], o.ctx[c] = K) && (!o.skip_bound && o.bound[c] && o.bound[c](K), s && Ee(e, c)), d; | ||
}) : [], o.update(), s = !0, P(o.before_update), o.fragment = r ? r(o.ctx) : !1, t.target) { | ||
if (t.hydrate) { | ||
const c = pe(t.target); | ||
o.fragment && o.fragment.l(c), c.forEach(y); | ||
o.fragment && o.fragment.l(c), c.forEach(h); | ||
} else | ||
o.fragment && o.fragment.c(); | ||
t.intro && _(e.$$.fragment), p(e, t.target, t.anchor, t.customElement), de(); | ||
t.intro && _(e.$$.fragment), p(e, t.target, t.anchor, t.customElement), ye(); | ||
} | ||
M(a); | ||
} | ||
class J { | ||
class H { | ||
$destroy() { | ||
@@ -209,8 +209,8 @@ A(this, 1), this.$destroy = b; | ||
$on(t, n) { | ||
if (!x(n)) | ||
if (!$(n)) | ||
return b; | ||
const r = this.$$.callbacks[t] || (this.$$.callbacks[t] = []); | ||
return r.push(n), () => { | ||
const l = r.indexOf(n); | ||
l !== -1 && r.splice(l, 1); | ||
const f = r.indexOf(n); | ||
f !== -1 && r.splice(f, 1); | ||
}; | ||
@@ -222,15 +222,15 @@ } | ||
} | ||
function q(e) { | ||
function D(e) { | ||
return e === null ? "null" : Array.isArray(e) ? "array" : e instanceof Map ? "map" : e instanceof Set ? "set" : typeof e; | ||
} | ||
function N(e) { | ||
function I(e) { | ||
return Array.isArray(e) || e instanceof Map || e instanceof Set ? [...e.entries()] : Object.entries(e); | ||
} | ||
function R(e) { | ||
const t = D(e); | ||
return t === "string" ? `${t}[v.length]` : t === "array" || t === "map" || t === "set" || t === "object" ? `${t}[${I(e).length}]` : t; | ||
} | ||
function U(e) { | ||
const t = q(e); | ||
return t === "string" ? `${t}[v.length]` : t === "array" || t === "map" || t === "set" || t === "object" ? `${t}[${N(e).length}]` : t; | ||
return I(e).sort(([t], [n]) => ("" + t).localeCompare(n)); | ||
} | ||
function W(e) { | ||
return N(e).sort(([t], [n]) => ("" + t).localeCompare(n)); | ||
} | ||
const Ke = ([e]) => String(e); | ||
@@ -241,14 +241,14 @@ function Ve(e) { | ||
c() { | ||
t = v("div"), r = S(n), k(t, "class", "magic-json-tree-key svelte-8rygun"); | ||
t = v("div"), r = j(n), k(t, "class", "magic-json-tree-key svelte-8rygun"); | ||
}, | ||
m(l, u) { | ||
h(l, t, u), D(t, r); | ||
m(f, u) { | ||
g(f, t, u), N(t, r); | ||
}, | ||
p(l, [u]) { | ||
u & 15 && n !== (n = l[3]([l[0], l[1]], l[2]) + "") && G(r, n); | ||
p(f, [u]) { | ||
u & 15 && n !== (n = f[3]([f[0], f[1]], f[2]) + "") && W(r, n); | ||
}, | ||
i: b, | ||
o: b, | ||
d(l) { | ||
l && y(t); | ||
d(f) { | ||
f && h(t); | ||
} | ||
@@ -258,135 +258,97 @@ }; | ||
function Ce(e, t, n) { | ||
let { key: r = null } = t, { value: l } = t, { path: u = [] } = t, { format: f = Ke } = t; | ||
let { key: r = null } = t, { value: f } = t, { path: u = [] } = t, { format: l = Ke } = t; | ||
return e.$$set = (i) => { | ||
"key" in i && n(0, r = i.key), "value" in i && n(1, l = i.value), "path" in i && n(2, u = i.path), "format" in i && n(3, f = i.format); | ||
}, [r, l, u, f]; | ||
"key" in i && n(0, r = i.key), "value" in i && n(1, f = i.value), "path" in i && n(2, u = i.path), "format" in i && n(3, l = i.format); | ||
}, [r, f, u, l]; | ||
} | ||
class Te extends J { | ||
class Te extends H { | ||
constructor(t) { | ||
super(), H(this, t, Ce, Ve, z, { key: 0, value: 1, path: 2, format: 3 }); | ||
super(), G(this, t, Ce, Ve, z, { key: 0, value: 1, path: 2, format: 3 }); | ||
} | ||
} | ||
const ye = Te; | ||
const de = Te; | ||
function Ne(e) { | ||
let t = e[3]([e[1], e[0]], e[2]) + "", n; | ||
let t, n = e[3]([e[1], e[0]], e[2]) + "", r, f; | ||
return { | ||
c() { | ||
n = S(t); | ||
t = v("div"), r = j(n), k(t, "class", f = "magic-json-tree-value magic-json-tree-value-" + D(e[0]) + " svelte-jtmsic"); | ||
}, | ||
m(r, l) { | ||
h(r, n, l); | ||
m(u, l) { | ||
g(u, t, l), N(t, r); | ||
}, | ||
p(r, l) { | ||
l & 15 && t !== (t = r[3]([r[1], r[0]], r[2]) + "") && G(n, t); | ||
p(u, [l]) { | ||
l & 15 && n !== (n = u[3]([u[1], u[0]], u[2]) + "") && W(r, n), l & 1 && f !== (f = "magic-json-tree-value magic-json-tree-value-" + D(u[0]) + " svelte-jtmsic") && k(t, "class", f); | ||
}, | ||
d(r) { | ||
r && y(n); | ||
} | ||
}; | ||
} | ||
function Ie(e) { | ||
let t = e[3]([e[1], e[0]], e[2]) + "", n; | ||
return { | ||
c() { | ||
n = S(t); | ||
}, | ||
m(r, l) { | ||
h(r, n, l); | ||
}, | ||
p(r, l) { | ||
l & 15 && t !== (t = r[3]([r[1], r[0]], r[2]) + "") && G(n, t); | ||
}, | ||
d(r) { | ||
r && y(n); | ||
} | ||
}; | ||
} | ||
function Oe(e) { | ||
let t, n; | ||
function r(f, i) { | ||
return typeof f[0] == "string" ? Ie : Ne; | ||
} | ||
let l = r(e), u = l(e); | ||
return { | ||
c() { | ||
t = v("div"), u.c(), k(t, "class", n = "magic-json-tree-value magic-json-tree-value-" + q(e[0]) + " svelte-jtmsic"); | ||
}, | ||
m(f, i) { | ||
h(f, t, i), u.m(t, null); | ||
}, | ||
p(f, [i]) { | ||
l === (l = r(f)) && u ? u.p(f, i) : (u.d(1), u = l(f), u && (u.c(), u.m(t, null))), i & 1 && n !== (n = "magic-json-tree-value magic-json-tree-value-" + q(f[0]) + " svelte-jtmsic") && k(t, "class", n); | ||
}, | ||
i: b, | ||
o: b, | ||
d(f) { | ||
f && y(t), u.d(); | ||
d(u) { | ||
u && h(t); | ||
} | ||
}; | ||
} | ||
function Fe(e, t, n) { | ||
let { value: r } = t, { key: l = null } = t, { path: u = [] } = t, { format: f = ([, i]) => `"${String(i)}"` } = t; | ||
function Ie(e, t, n) { | ||
let { value: r } = t, { key: f = null } = t, { path: u = [] } = t, { format: l = ([, i]) => typeof i == "string" ? `"${String(i)}"` : typeof i == "symbol" ? `${String(i)}` : i } = t; | ||
return e.$$set = (i) => { | ||
"value" in i && n(0, r = i.value), "key" in i && n(1, l = i.key), "path" in i && n(2, u = i.path), "format" in i && n(3, f = i.format); | ||
}, [r, l, u, f]; | ||
"value" in i && n(0, r = i.value), "key" in i && n(1, f = i.key), "path" in i && n(2, u = i.path), "format" in i && n(3, l = i.format); | ||
}, [r, f, u, l]; | ||
} | ||
class Be extends J { | ||
class Oe extends H { | ||
constructor(t) { | ||
super(), H(this, t, Fe, Oe, z, { value: 0, key: 1, path: 2, format: 3 }); | ||
super(), G(this, t, Ie, Ne, z, { value: 0, key: 1, path: 2, format: 3 }); | ||
} | ||
} | ||
const he = Be; | ||
function Le(e) { | ||
let t = U(e[0]) + "", n; | ||
const he = Oe; | ||
function Fe(e) { | ||
let t = R(e[0]) + "", n; | ||
return { | ||
c() { | ||
n = S(t); | ||
n = j(t); | ||
}, | ||
m(r, l) { | ||
h(r, n, l); | ||
m(r, f) { | ||
g(r, n, f); | ||
}, | ||
p(r, l) { | ||
l & 1 && t !== (t = U(r[0]) + "") && G(n, t); | ||
p(r, f) { | ||
f & 1 && t !== (t = R(r[0]) + "") && W(n, t); | ||
}, | ||
d(r) { | ||
r && y(n); | ||
r && h(n); | ||
} | ||
}; | ||
} | ||
function Me(e) { | ||
function qe(e) { | ||
var r; | ||
let t = ((r = e[2]([e[3], e[0]], e[4])) != null ? r : U(e[0])) + "", n; | ||
let t = ((r = e[2]([e[3], e[0]], e[4])) != null ? r : R(e[0])) + "", n; | ||
return { | ||
c() { | ||
n = S(t); | ||
n = j(t); | ||
}, | ||
m(l, u) { | ||
h(l, n, u); | ||
m(f, u) { | ||
g(f, n, u); | ||
}, | ||
p(l, u) { | ||
var f; | ||
u & 29 && t !== (t = ((f = l[2]([l[3], l[0]], l[4])) != null ? f : U(l[0])) + "") && G(n, t); | ||
p(f, u) { | ||
var l; | ||
u & 29 && t !== (t = ((l = f[2]([f[3], f[0]], f[4])) != null ? l : R(f[0])) + "") && W(n, t); | ||
}, | ||
d(l) { | ||
l && y(n); | ||
d(f) { | ||
f && h(n); | ||
} | ||
}; | ||
} | ||
function De(e) { | ||
let t, n, r, l, u; | ||
function f(o, s) { | ||
return o[2] ? Me : Le; | ||
function Be(e) { | ||
let t, n, r, f, u; | ||
function l(o, s) { | ||
return o[2] ? qe : Fe; | ||
} | ||
let i = f(e), a = i(e); | ||
let i = l(e), a = i(e); | ||
return { | ||
c() { | ||
t = v("a"), n = v("span"), n.textContent = "\u2023", r = v("span"), a.c(), k(n, "class", "arrow"), k(r, "class", "summary-content svelte-1ieu0sp"), k(t, "class", "magic-json-tree-summary svelte-1ieu0sp"), k(t, "href", "#"); | ||
t = v("a"), n = v("span"), n.textContent = "\u2023", r = v("span"), a.c(), k(n, "class", "arrow"), k(r, "class", "summary-content svelte-118rq9f"), k(t, "class", "magic-json-tree-summary svelte-118rq9f"), k(t, "href", "#"); | ||
}, | ||
m(o, s) { | ||
h(o, t, s), D(t, n), D(t, r), a.m(r, null), l || (u = be(t, "click", function() { | ||
x(e[1]) && e[1].apply(this, arguments); | ||
}), l = !0); | ||
g(o, t, s), N(t, n), N(t, r), a.m(r, null), f || (u = be(t, "click", function() { | ||
$(e[1]) && e[1].apply(this, arguments); | ||
}), f = !0); | ||
}, | ||
p(o, [s]) { | ||
e = o, i === (i = f(e)) && a ? a.p(e, s) : (a.d(1), a = i(e), a && (a.c(), a.m(r, null))); | ||
e = o, i === (i = l(e)) && a ? a.p(e, s) : (a.d(1), a = i(e), a && (a.c(), a.m(r, null))); | ||
}, | ||
@@ -396,15 +358,15 @@ i: b, | ||
d(o) { | ||
o && y(t), a.d(), l = !1, u(); | ||
o && h(t), a.d(), f = !1, u(); | ||
} | ||
}; | ||
} | ||
function qe(e, t, n) { | ||
let { value: r } = t, { onClick: l } = t, { format: u } = t, { key: f = null } = t, { path: i = [] } = t; | ||
function Le(e, t, n) { | ||
let { value: r } = t, { onClick: f } = t, { format: u } = t, { key: l = null } = t, { path: i = [] } = t; | ||
return e.$$set = (a) => { | ||
"value" in a && n(0, r = a.value), "onClick" in a && n(1, l = a.onClick), "format" in a && n(2, u = a.format), "key" in a && n(3, f = a.key), "path" in a && n(4, i = a.path); | ||
}, [r, l, u, f, i]; | ||
"value" in a && n(0, r = a.value), "onClick" in a && n(1, f = a.onClick), "format" in a && n(2, u = a.format), "key" in a && n(3, l = a.key), "path" in a && n(4, i = a.path); | ||
}, [r, f, u, l, i]; | ||
} | ||
class Pe extends J { | ||
class Me extends H { | ||
constructor(t) { | ||
super(), H(this, t, qe, De, z, { | ||
super(), G(this, t, Le, Be, z, { | ||
value: 0, | ||
@@ -418,10 +380,10 @@ onClick: 1, | ||
} | ||
const ge = Pe; | ||
function le(e, t, n) { | ||
const ge = Me; | ||
function fe(e, t, n) { | ||
const r = e.slice(); | ||
return r[14] = t[n][0], r[15] = t[n][1], r; | ||
} | ||
function ze(e) { | ||
let t, n, r, l, u; | ||
return n = new ye({ | ||
function De(e) { | ||
let t, n, r, f, u; | ||
return n = new de({ | ||
props: { | ||
@@ -433,3 +395,3 @@ key: e[0], | ||
} | ||
}), l = new he({ | ||
}), f = new he({ | ||
props: { | ||
@@ -443,27 +405,27 @@ key: e[0], | ||
c() { | ||
t = v("div"), j(n.$$.fragment), r = S(":"), j(l.$$.fragment), k(t, "class", "key-line svelte-o8j8yy"); | ||
t = v("div"), S(n.$$.fragment), r = j(":"), S(f.$$.fragment), k(t, "class", "key-line svelte-o8j8yy"); | ||
}, | ||
m(f, i) { | ||
h(f, t, i), p(n, t, null), D(t, r), p(l, t, null), u = !0; | ||
m(l, i) { | ||
g(l, t, i), p(n, t, null), N(t, r), p(f, t, null), u = !0; | ||
}, | ||
p(f, i) { | ||
p(l, i) { | ||
const a = {}; | ||
i & 1 && (a.key = f[0]), i & 2 && (a.value = f[1]), i & 4 && (a.path = f[2]), i & 8 && (a.format = f[3]), n.$set(a); | ||
i & 1 && (a.key = l[0]), i & 2 && (a.value = l[1]), i & 4 && (a.path = l[2]), i & 8 && (a.format = l[3]), n.$set(a); | ||
const o = {}; | ||
i & 1 && (o.key = f[0]), i & 2 && (o.value = f[1]), i & 4 && (o.path = f[2]), i & 16 && (o.format = f[4]), l.$set(o); | ||
i & 1 && (o.key = l[0]), i & 2 && (o.value = l[1]), i & 4 && (o.path = l[2]), i & 16 && (o.format = l[4]), f.$set(o); | ||
}, | ||
i(f) { | ||
u || (_(n.$$.fragment, f), _(l.$$.fragment, f), u = !0); | ||
i(l) { | ||
u || (_(n.$$.fragment, l), _(f.$$.fragment, l), u = !0); | ||
}, | ||
o(f) { | ||
d(n.$$.fragment, f), d(l.$$.fragment, f), u = !1; | ||
o(l) { | ||
y(n.$$.fragment, l), y(f.$$.fragment, l), u = !1; | ||
}, | ||
d(f) { | ||
f && y(t), A(n), A(l); | ||
d(l) { | ||
l && h(t), A(n), A(f); | ||
} | ||
}; | ||
} | ||
function Ge(e) { | ||
let t, n, r, l, u, f, i; | ||
n = new ye({ | ||
function Pe(e) { | ||
let t, n, r, f, u, l, i; | ||
n = new de({ | ||
props: { | ||
@@ -475,3 +437,3 @@ key: e[0], | ||
} | ||
}), l = new ge({ | ||
}), f = new ge({ | ||
props: { | ||
@@ -485,9 +447,9 @@ value: e[1], | ||
}); | ||
let a = e[8] && fe(e); | ||
let a = e[8] && le(e); | ||
return { | ||
c() { | ||
t = v("div"), j(n.$$.fragment), r = S(":"), j(l.$$.fragment), u = ce(), a && a.c(), f = _e(), k(t, "class", "key-line svelte-o8j8yy"); | ||
t = v("div"), S(n.$$.fragment), r = j(":"), S(f.$$.fragment), u = ce(), a && a.c(), l = _e(), k(t, "class", "key-line svelte-o8j8yy"); | ||
}, | ||
m(o, s) { | ||
h(o, t, s), p(n, t, null), D(t, r), p(l, t, null), h(o, u, s), a && a.m(o, s), h(o, f, s), i = !0; | ||
g(o, t, s), p(n, t, null), N(t, r), p(f, t, null), g(o, u, s), a && a.m(o, s), g(o, l, s), i = !0; | ||
}, | ||
@@ -497,24 +459,24 @@ p(o, s) { | ||
s & 1 && (c.key = o[0]), s & 2 && (c.value = o[1]), s & 4 && (c.path = o[2]), s & 8 && (c.format = o[3]), n.$set(c); | ||
const g = {}; | ||
s & 2 && (g.value = o[1]), s & 1 && (g.key = o[0]), s & 4 && (g.path = o[2]), s & 32 && (g.format = o[5]), l.$set(g), o[8] ? a ? (a.p(o, s), s & 256 && _(a, 1)) : (a = fe(o), a.c(), _(a, 1), a.m(f.parentNode, f)) : a && (I(), d(a, 1, 1, () => { | ||
const d = {}; | ||
s & 2 && (d.value = o[1]), s & 1 && (d.key = o[0]), s & 4 && (d.path = o[2]), s & 32 && (d.format = o[5]), f.$set(d), o[8] ? a ? (a.p(o, s), s & 256 && _(a, 1)) : (a = le(o), a.c(), _(a, 1), a.m(l.parentNode, l)) : a && (O(), y(a, 1, 1, () => { | ||
a = null; | ||
}), O()); | ||
}), F()); | ||
}, | ||
i(o) { | ||
i || (_(n.$$.fragment, o), _(l.$$.fragment, o), _(a), i = !0); | ||
i || (_(n.$$.fragment, o), _(f.$$.fragment, o), _(a), i = !0); | ||
}, | ||
o(o) { | ||
d(n.$$.fragment, o), d(l.$$.fragment, o), d(a), i = !1; | ||
y(n.$$.fragment, o), y(f.$$.fragment, o), y(a), i = !1; | ||
}, | ||
d(o) { | ||
o && y(t), A(n), A(l), o && y(u), a && a.d(o), o && y(f); | ||
o && h(t), A(n), A(f), o && h(u), a && a.d(o), o && h(l); | ||
} | ||
}; | ||
} | ||
function fe(e) { | ||
let t, n, r = e[9](e[1]), l = []; | ||
for (let f = 0; f < r.length; f += 1) | ||
l[f] = ae(le(e, r, f)); | ||
const u = (f) => d(l[f], 1, 1, () => { | ||
l[f] = null; | ||
function le(e) { | ||
let t, n, r = e[9](e[1]), f = []; | ||
for (let l = 0; l < r.length; l += 1) | ||
f[l] = ae(fe(e, r, l)); | ||
const u = (l) => y(f[l], 1, 1, () => { | ||
f[l] = null; | ||
}); | ||
@@ -524,40 +486,40 @@ return { | ||
t = v("div"); | ||
for (let f = 0; f < l.length; f += 1) | ||
l[f].c(); | ||
for (let l = 0; l < f.length; l += 1) | ||
f[l].c(); | ||
k(t, "class", "magic-json-tree-object-items"); | ||
}, | ||
m(f, i) { | ||
h(f, t, i); | ||
for (let a = 0; a < l.length; a += 1) | ||
l[a] && l[a].m(t, null); | ||
m(l, i) { | ||
g(l, t, i); | ||
for (let a = 0; a < f.length; a += 1) | ||
f[a] && f[a].m(t, null); | ||
n = !0; | ||
}, | ||
p(f, i) { | ||
p(l, i) { | ||
if (i & 6910) { | ||
r = f[9](f[1]); | ||
r = l[9](l[1]); | ||
let a; | ||
for (a = 0; a < r.length; a += 1) { | ||
const o = le(f, r, a); | ||
l[a] ? (l[a].p(o, i), _(l[a], 1)) : (l[a] = ae(o), l[a].c(), _(l[a], 1), l[a].m(t, null)); | ||
const o = fe(l, r, a); | ||
f[a] ? (f[a].p(o, i), _(f[a], 1)) : (f[a] = ae(o), f[a].c(), _(f[a], 1), f[a].m(t, null)); | ||
} | ||
for (I(), a = r.length; a < l.length; a += 1) | ||
for (O(), a = r.length; a < f.length; a += 1) | ||
u(a); | ||
O(); | ||
F(); | ||
} | ||
}, | ||
i(f) { | ||
i(l) { | ||
if (!n) { | ||
for (let i = 0; i < r.length; i += 1) | ||
_(l[i]); | ||
_(f[i]); | ||
n = !0; | ||
} | ||
}, | ||
o(f) { | ||
l = l.filter(Boolean); | ||
for (let i = 0; i < l.length; i += 1) | ||
d(l[i]); | ||
o(l) { | ||
f = f.filter(Boolean); | ||
for (let i = 0; i < f.length; i += 1) | ||
y(f[i]); | ||
n = !1; | ||
}, | ||
d(f) { | ||
f && y(t), me(l, f); | ||
d(l) { | ||
l && h(t), me(f, l); | ||
} | ||
@@ -581,10 +543,10 @@ }; | ||
c() { | ||
j(t.$$.fragment); | ||
S(t.$$.fragment); | ||
}, | ||
m(r, l) { | ||
p(t, r, l), n = !0; | ||
m(r, f) { | ||
p(t, r, f), n = !0; | ||
}, | ||
p(r, l) { | ||
p(r, f) { | ||
const u = {}; | ||
l & 514 && (u.key = r[14]), l & 514 && (u.value = r[15]), l & 64 && (u.level = r[6] + 1), l & 518 && (u.path = [...r[2], r[14]]), l & 8 && (u.formatKey = r[3]), l & 16 && (u.formatValue = r[4]), l & 32 && (u.formatSummary = r[5]), l & 642 && (u.expand = Array.isArray(r[7]) ? r[11] === r[14] ? r[12] : 0 : r[7]), t.$set(u); | ||
f & 514 && (u.key = r[14]), f & 514 && (u.value = r[15]), f & 64 && (u.level = r[6] + 1), f & 518 && (u.path = [...r[2], r[14]]), f & 8 && (u.formatKey = r[3]), f & 16 && (u.formatValue = r[4]), f & 32 && (u.formatSummary = r[5]), f & 642 && (u.expand = Array.isArray(r[7]) ? r[11] === r[14] ? r[12] : 0 : r[7]), t.$set(u); | ||
}, | ||
@@ -595,3 +557,3 @@ i(r) { | ||
o(r) { | ||
d(t.$$.fragment, r), n = !1; | ||
y(t.$$.fragment, r), n = !1; | ||
}, | ||
@@ -603,20 +565,20 @@ d(r) { | ||
} | ||
function He(e) { | ||
let t, n, r, l, u; | ||
const f = [Ge, ze], i = []; | ||
function ze(e) { | ||
let t, n, r, f, u; | ||
const l = [Pe, De], i = []; | ||
function a(o, s) { | ||
return typeof o[1] == "object" && o[1] !== null ? 0 : 1; | ||
} | ||
return n = a(e), r = i[n] = f[n](e), { | ||
return n = a(e), r = i[n] = l[n](e), { | ||
c() { | ||
t = v("div"), r.c(), k(t, "class", l = "magic-json-tree-item magic-json-tree-item-" + q(e[1]) + " svelte-o8j8yy"), R(t, "expanded", e[8]); | ||
t = v("div"), r.c(), k(t, "class", f = "magic-json-tree-item magic-json-tree-item-" + D(e[1]) + " svelte-o8j8yy"), Q(t, "expanded", e[8]); | ||
}, | ||
m(o, s) { | ||
h(o, t, s), i[n].m(t, null), u = !0; | ||
g(o, t, s), i[n].m(t, null), u = !0; | ||
}, | ||
p(o, [s]) { | ||
let c = n; | ||
n = a(o), n === c ? i[n].p(o, s) : (I(), d(i[c], 1, 1, () => { | ||
n = a(o), n === c ? i[n].p(o, s) : (O(), y(i[c], 1, 1, () => { | ||
i[c] = null; | ||
}), O(), r = i[n], r ? r.p(o, s) : (r = i[n] = f[n](o), r.c()), _(r, 1), r.m(t, null)), (!u || s & 2 && l !== (l = "magic-json-tree-item magic-json-tree-item-" + q(o[1]) + " svelte-o8j8yy")) && k(t, "class", l), (!u || s & 258) && R(t, "expanded", o[8]); | ||
}), F(), r = i[n], r ? r.p(o, s) : (r = i[n] = l[n](o), r.c()), _(r, 1), r.m(t, null)), (!u || s & 2 && f !== (f = "magic-json-tree-item magic-json-tree-item-" + D(o[1]) + " svelte-o8j8yy")) && k(t, "class", f), (!u || s & 258) && Q(t, "expanded", o[8]); | ||
}, | ||
@@ -627,25 +589,25 @@ i(o) { | ||
o(o) { | ||
d(r), u = !1; | ||
y(r), u = !1; | ||
}, | ||
d(o) { | ||
o && y(t), i[n].d(); | ||
o && h(t), i[n].d(); | ||
} | ||
}; | ||
} | ||
function Je(e, t, n) { | ||
let { key: r } = t, { value: l } = t, { path: u = [] } = t, { formatKey: f } = t, { formatValue: i } = t, { formatSummary: a } = t, { level: o = 2 } = t, { expand: s } = t, { sorted: c = !1 } = t, g = Array.isArray(s) ? !0 : s >= o; | ||
function Ge(e, t, n) { | ||
let { key: r } = t, { value: f } = t, { path: u = [] } = t, { formatKey: l } = t, { formatValue: i } = t, { formatSummary: a } = t, { level: o = 2 } = t, { expand: s } = t, { sorted: c = !1 } = t, d = Array.isArray(s) ? !0 : s >= o; | ||
function E(m) { | ||
n(8, g = !g), m.preventDefault(); | ||
n(8, d = !d), m.preventDefault(); | ||
} | ||
const [K, ...X] = Array.isArray(s) ? s : []; | ||
let F = c ? W : N; | ||
let q = c ? U : I; | ||
return e.$$set = (m) => { | ||
"key" in m && n(0, r = m.key), "value" in m && n(1, l = m.value), "path" in m && n(2, u = m.path), "formatKey" in m && n(3, f = m.formatKey), "formatValue" in m && n(4, i = m.formatValue), "formatSummary" in m && n(5, a = m.formatSummary), "level" in m && n(6, o = m.level), "expand" in m && n(7, s = m.expand), "sorted" in m && n(13, c = m.sorted); | ||
"key" in m && n(0, r = m.key), "value" in m && n(1, f = m.value), "path" in m && n(2, u = m.path), "formatKey" in m && n(3, l = m.formatKey), "formatValue" in m && n(4, i = m.formatValue), "formatSummary" in m && n(5, a = m.formatSummary), "level" in m && n(6, o = m.level), "expand" in m && n(7, s = m.expand), "sorted" in m && n(13, c = m.sorted); | ||
}, e.$$.update = () => { | ||
e.$$.dirty & 8192 && n(9, F = c ? W : N); | ||
e.$$.dirty & 8192 && n(9, q = c ? U : I); | ||
}, [ | ||
r, | ||
f, | ||
u, | ||
l, | ||
u, | ||
f, | ||
i, | ||
@@ -655,4 +617,4 @@ a, | ||
s, | ||
g, | ||
F, | ||
d, | ||
q, | ||
E, | ||
@@ -664,5 +626,5 @@ K, | ||
} | ||
class ke extends J { | ||
class ke extends H { | ||
constructor(t) { | ||
super(), H(this, t, Je, He, z, { | ||
super(), G(this, t, Ge, ze, z, { | ||
key: 0, | ||
@@ -680,3 +642,3 @@ value: 1, | ||
} | ||
const Qe = ke; | ||
const He = ke; | ||
function ue(e, t, n) { | ||
@@ -686,3 +648,3 @@ const r = e.slice(); | ||
} | ||
function Re(e) { | ||
function Je(e) { | ||
let t, n; | ||
@@ -696,10 +658,10 @@ return t = new he({ | ||
c() { | ||
j(t.$$.fragment); | ||
S(t.$$.fragment); | ||
}, | ||
m(r, l) { | ||
p(t, r, l), n = !0; | ||
m(r, f) { | ||
p(t, r, f), n = !0; | ||
}, | ||
p(r, l) { | ||
p(r, f) { | ||
const u = {}; | ||
l & 1 && (u.value = r[0]), l & 16 && (u.format = r[4]), t.$set(u); | ||
f & 1 && (u.value = r[0]), f & 16 && (u.format = r[4]), t.$set(u); | ||
}, | ||
@@ -710,3 +672,3 @@ i(r) { | ||
o(r) { | ||
d(t.$$.fragment, r), n = !1; | ||
y(t.$$.fragment, r), n = !1; | ||
}, | ||
@@ -718,4 +680,4 @@ d(r) { | ||
} | ||
function Ue(e) { | ||
let t, n, r, l; | ||
function Qe(e) { | ||
let t, n, r, f; | ||
t = new ge({ | ||
@@ -731,21 +693,21 @@ props: { | ||
c() { | ||
j(t.$$.fragment), n = ce(), u && u.c(), r = _e(); | ||
S(t.$$.fragment), n = ce(), u && u.c(), r = _e(); | ||
}, | ||
m(f, i) { | ||
p(t, f, i), h(f, n, i), u && u.m(f, i), h(f, r, i), l = !0; | ||
m(l, i) { | ||
p(t, l, i), g(l, n, i), u && u.m(l, i), g(l, r, i), f = !0; | ||
}, | ||
p(f, i) { | ||
p(l, i) { | ||
const a = {}; | ||
i & 1 && (a.value = f[0]), i & 32 && (a.format = f[5]), t.$set(a), f[6] ? u ? (u.p(f, i), i & 64 && _(u, 1)) : (u = ie(f), u.c(), _(u, 1), u.m(r.parentNode, r)) : u && (I(), d(u, 1, 1, () => { | ||
i & 1 && (a.value = l[0]), i & 32 && (a.format = l[5]), t.$set(a), l[6] ? u ? (u.p(l, i), i & 64 && _(u, 1)) : (u = ie(l), u.c(), _(u, 1), u.m(r.parentNode, r)) : u && (O(), y(u, 1, 1, () => { | ||
u = null; | ||
}), O()); | ||
}), F()); | ||
}, | ||
i(f) { | ||
l || (_(t.$$.fragment, f), _(u), l = !0); | ||
i(l) { | ||
f || (_(t.$$.fragment, l), _(u), f = !0); | ||
}, | ||
o(f) { | ||
d(t.$$.fragment, f), d(u), l = !1; | ||
o(l) { | ||
y(t.$$.fragment, l), y(u), f = !1; | ||
}, | ||
d(f) { | ||
A(t, f), f && y(n), u && u.d(f), f && y(r); | ||
d(l) { | ||
A(t, l), l && h(n), u && u.d(l), l && h(r); | ||
} | ||
@@ -755,7 +717,7 @@ }; | ||
function ie(e) { | ||
let t, n, r = e[7](e[0]), l = []; | ||
for (let f = 0; f < r.length; f += 1) | ||
l[f] = oe(ue(e, r, f)); | ||
const u = (f) => d(l[f], 1, 1, () => { | ||
l[f] = null; | ||
let t, n, r = e[7](e[0]), f = []; | ||
for (let l = 0; l < r.length; l += 1) | ||
f[l] = oe(ue(e, r, l)); | ||
const u = (l) => y(f[l], 1, 1, () => { | ||
f[l] = null; | ||
}); | ||
@@ -765,40 +727,40 @@ return { | ||
t = v("div"); | ||
for (let f = 0; f < l.length; f += 1) | ||
l[f].c(); | ||
for (let l = 0; l < f.length; l += 1) | ||
f[l].c(); | ||
k(t, "class", "magic-json-tree-object-items"); | ||
}, | ||
m(f, i) { | ||
h(f, t, i); | ||
for (let a = 0; a < l.length; a += 1) | ||
l[a] && l[a].m(t, null); | ||
m(l, i) { | ||
g(l, t, i); | ||
for (let a = 0; a < f.length; a += 1) | ||
f[a] && f[a].m(t, null); | ||
n = !0; | ||
}, | ||
p(f, i) { | ||
p(l, i) { | ||
if (i & 1727) { | ||
r = f[7](f[0]); | ||
r = l[7](l[0]); | ||
let a; | ||
for (a = 0; a < r.length; a += 1) { | ||
const o = ue(f, r, a); | ||
l[a] ? (l[a].p(o, i), _(l[a], 1)) : (l[a] = oe(o), l[a].c(), _(l[a], 1), l[a].m(t, null)); | ||
const o = ue(l, r, a); | ||
f[a] ? (f[a].p(o, i), _(f[a], 1)) : (f[a] = oe(o), f[a].c(), _(f[a], 1), f[a].m(t, null)); | ||
} | ||
for (I(), a = r.length; a < l.length; a += 1) | ||
for (O(), a = r.length; a < f.length; a += 1) | ||
u(a); | ||
O(); | ||
F(); | ||
} | ||
}, | ||
i(f) { | ||
i(l) { | ||
if (!n) { | ||
for (let i = 0; i < r.length; i += 1) | ||
_(l[i]); | ||
_(f[i]); | ||
n = !0; | ||
} | ||
}, | ||
o(f) { | ||
l = l.filter(Boolean); | ||
for (let i = 0; i < l.length; i += 1) | ||
d(l[i]); | ||
o(l) { | ||
f = f.filter(Boolean); | ||
for (let i = 0; i < f.length; i += 1) | ||
y(f[i]); | ||
n = !1; | ||
}, | ||
d(f) { | ||
f && y(t), me(l, f); | ||
d(l) { | ||
l && h(t), me(f, l); | ||
} | ||
@@ -809,3 +771,3 @@ }; | ||
let t, n; | ||
return t = new Qe({ | ||
return t = new He({ | ||
props: { | ||
@@ -824,10 +786,10 @@ key: e[14], | ||
c() { | ||
j(t.$$.fragment); | ||
S(t.$$.fragment); | ||
}, | ||
m(r, l) { | ||
p(t, r, l), n = !0; | ||
m(r, f) { | ||
p(t, r, f), n = !0; | ||
}, | ||
p(r, l) { | ||
p(r, f) { | ||
const u = {}; | ||
l & 129 && (u.key = r[14]), l & 129 && (u.value = r[15]), l & 129 && (u.path = [r[14]]), l & 8 && (u.formatKey = r[3]), l & 16 && (u.formatValue = r[4]), l & 32 && (u.formatSummary = r[5]), l & 4 && (u.sorted = r[2]), l & 131 && (u.expand = Array.isArray(r[1]) ? r[9] === r[14] ? r[10] : 0 : r[1]), t.$set(u); | ||
f & 129 && (u.key = r[14]), f & 129 && (u.value = r[15]), f & 129 && (u.path = [r[14]]), f & 8 && (u.formatKey = r[3]), f & 16 && (u.formatValue = r[4]), f & 32 && (u.formatSummary = r[5]), f & 4 && (u.sorted = r[2]), f & 131 && (u.expand = Array.isArray(r[1]) ? r[9] === r[14] ? r[10] : 0 : r[1]), t.$set(u); | ||
}, | ||
@@ -838,3 +800,3 @@ i(r) { | ||
o(r) { | ||
d(t.$$.fragment, r), n = !1; | ||
y(t.$$.fragment, r), n = !1; | ||
}, | ||
@@ -846,41 +808,41 @@ d(r) { | ||
} | ||
function We(e) { | ||
let t, n, r, l; | ||
const u = [Ue, Re], f = []; | ||
function Re(e) { | ||
let t, n, r, f; | ||
const u = [Qe, Je], l = []; | ||
function i(a, o) { | ||
return typeof a[0] == "object" && a[0] !== null ? 0 : 1; | ||
} | ||
return n = i(e), r = f[n] = u[n](e), { | ||
return n = i(e), r = l[n] = u[n](e), { | ||
c() { | ||
t = v("div"), r.c(), k(t, "class", "magic-json-tree-root svelte-1slccqa"), R(t, "expanded", e[6]); | ||
t = v("div"), r.c(), k(t, "class", "magic-json-tree-root svelte-1slccqa"), Q(t, "expanded", e[6]); | ||
}, | ||
m(a, o) { | ||
h(a, t, o), f[n].m(t, null), l = !0; | ||
g(a, t, o), l[n].m(t, null), f = !0; | ||
}, | ||
p(a, [o]) { | ||
let s = n; | ||
n = i(a), n === s ? f[n].p(a, o) : (I(), d(f[s], 1, 1, () => { | ||
f[s] = null; | ||
}), O(), r = f[n], r ? r.p(a, o) : (r = f[n] = u[n](a), r.c()), _(r, 1), r.m(t, null)), (!l || o & 64) && R(t, "expanded", a[6]); | ||
n = i(a), n === s ? l[n].p(a, o) : (O(), y(l[s], 1, 1, () => { | ||
l[s] = null; | ||
}), F(), r = l[n], r ? r.p(a, o) : (r = l[n] = u[n](a), r.c()), _(r, 1), r.m(t, null)), (!f || o & 64) && Q(t, "expanded", a[6]); | ||
}, | ||
i(a) { | ||
l || (_(r), l = !0); | ||
f || (_(r), f = !0); | ||
}, | ||
o(a) { | ||
d(r), l = !1; | ||
y(r), f = !1; | ||
}, | ||
d(a) { | ||
a && y(t), f[n].d(); | ||
a && h(t), l[n].d(); | ||
} | ||
}; | ||
} | ||
function Xe(e, t, n) { | ||
let { value: r } = t, { expand: l = 0 } = t, { formatKey: u = void 0 } = t, { formatValue: f = void 0 } = t, { formatSummary: i = void 0 } = t, { sorted: a = !1 } = t, o, s, c, g = Array.isArray(l) ? !0 : l >= 1; | ||
function Ue(e, t, n) { | ||
let { value: r } = t, { expand: f = 0 } = t, { formatKey: u = void 0 } = t, { formatValue: l = void 0 } = t, { formatSummary: i = void 0 } = t, { sorted: a = !1 } = t, o, s, c, d = Array.isArray(f) ? !0 : f >= 1; | ||
function E(m) { | ||
n(6, g = !g), m.preventDefault(); | ||
n(6, d = !d), m.preventDefault(); | ||
} | ||
const [K, ...X] = Array.isArray(l) ? l : []; | ||
let F = a ? W : N; | ||
const [K, ...X] = Array.isArray(f) ? f : []; | ||
let q = a ? U : I; | ||
return e.$$set = (m) => { | ||
"value" in m && n(0, r = m.value), "expand" in m && n(1, l = m.expand), "formatKey" in m && n(11, u = m.formatKey), "formatValue" in m && n(12, f = m.formatValue), "formatSummary" in m && n(13, i = m.formatSummary), "sorted" in m && n(2, a = m.sorted); | ||
"value" in m && n(0, r = m.value), "expand" in m && n(1, f = m.expand), "formatKey" in m && n(11, u = m.formatKey), "formatValue" in m && n(12, l = m.formatValue), "formatSummary" in m && n(13, i = m.formatSummary), "sorted" in m && n(2, a = m.sorted); | ||
}, e.$$.update = () => { | ||
@@ -893,5 +855,5 @@ e.$$.dirty & 2048 && typeof u == "function" && n(3, o = (m, B) => { | ||
} | ||
}), e.$$.dirty & 4096 && typeof f == "function" && n(4, s = (m, B) => { | ||
}), e.$$.dirty & 4096 && typeof l == "function" && n(4, s = (m, B) => { | ||
try { | ||
return f(m, B); | ||
return l(m, B); | ||
} catch (L) { | ||
@@ -906,6 +868,6 @@ return console.error("The passed `formatValue` function threw an error. An unformatted value will be rendered.\n", L), m[1]; | ||
} | ||
}), e.$$.dirty & 4 && n(7, F = a ? W : N); | ||
}), e.$$.dirty & 4 && n(7, q = a ? U : I); | ||
}, [ | ||
r, | ||
l, | ||
f, | ||
a, | ||
@@ -915,4 +877,4 @@ o, | ||
c, | ||
g, | ||
F, | ||
d, | ||
q, | ||
E, | ||
@@ -922,9 +884,9 @@ K, | ||
u, | ||
f, | ||
l, | ||
i | ||
]; | ||
} | ||
class Ye extends J { | ||
class We extends H { | ||
constructor(t) { | ||
super(), H(this, t, Xe, We, z, { | ||
super(), G(this, t, Ue, Re, z, { | ||
value: 0, | ||
@@ -939,6 +901,6 @@ expand: 1, | ||
} | ||
const $e = Ye; | ||
const Ye = We; | ||
export { | ||
$e as default, | ||
U as getTypeSummary | ||
Ye as default, | ||
R as getTypeSummary | ||
}; |
{ | ||
"name": "magic-json-tree", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"author": "Richard Laffers", | ||
@@ -5,0 +5,0 @@ "license": "ISC", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57926
986