@contentful/content-source-maps
Advanced tools
Comparing version 0.11.1 to 0.11.2
@@ -24,3 +24,3 @@ var R = { 0: 8203, 1: 8204, 2: 8205, 3: 8290, 4: 8291, 5: 8288, 6: 65279, 7: 8289, 8: 119155, 9: 119156, a: 119157, b: 119158, c: 119159, d: 119160, e: 119161, f: 119162 }, b = { 0: 8203, 1: 8204, 2: 8205, 3: 65279 }, V = new Array(4).fill(String.fromCodePoint(b[0])).join(""), J = "\0"; | ||
} | ||
var G = Object.fromEntries(Object.entries(b).map((e) => e.reverse())), k = Object.fromEntries(Object.entries(R).map((e) => e.reverse())), Z = `${Object.values(R).map((e) => `\\u{${e.toString(16)}}`).join("")}`, I = new RegExp(`[${Z}]{4,}`, "gu"); | ||
var Z = Object.fromEntries(Object.entries(b).map((e) => e.reverse())), k = Object.fromEntries(Object.entries(R).map((e) => e.reverse())), G = `${Object.values(R).map((e) => `\\u{${e.toString(16)}}`).join("")}`, I = new RegExp(`[${G}]{4,}`, "gu"); | ||
function H(e) { | ||
@@ -37,3 +37,3 @@ let t = e.match(I); | ||
for (let r = o.length * 0.25; r--; ) { | ||
let s = o.slice(r * 4, r * 4 + 4).map((i) => G[i.codePointAt(0)]).join(""); | ||
let s = o.slice(r * 4, r * 4 + 4).map((i) => Z[i.codePointAt(0)]).join(""); | ||
n.unshift(String.fromCharCode(parseInt(s, 4))); | ||
@@ -95,3 +95,3 @@ } | ||
q.call(t, i) && o.call(n, t[i], i, t); | ||
}, ne = te, h = a; | ||
}, ne = te, y = a; | ||
function a(e, t, o) { | ||
@@ -191,7 +191,7 @@ if (arguments.length === 3) | ||
t[i] = r; | ||
const c = h.get(o, i), u = T(c, n); | ||
h.set(o, i, u); | ||
const c = y.get(o, i), u = T(c, n); | ||
y.set(o, i, u); | ||
} | ||
}, F = (e, t = "") => { | ||
const o = [], n = h.get(e, t); | ||
const o = [], n = y.get(e, t); | ||
if (n.content) | ||
@@ -251,3 +251,3 @@ for (let r = 0; r < n.content.length; r++) | ||
const u = T(c, o); | ||
h.set(n, r, u); | ||
y.set(n, r, u); | ||
break; | ||
@@ -257,3 +257,3 @@ } | ||
const u = T(c, o); | ||
h.set(n, r, u); | ||
y.set(n, r, u); | ||
break; | ||
@@ -272,3 +272,3 @@ } | ||
const u = c.map((f) => typeof f == "string" ? T(f, o) : f); | ||
h.set(n, r, u); | ||
y.set(n, r, u); | ||
break; | ||
@@ -296,3 +296,3 @@ } | ||
fieldTypes: v | ||
} = n.extensions.contentSourceMaps, y = n; | ||
} = n.extensions.contentSourceMaps, h = n; | ||
for (const d in g) { | ||
@@ -302,26 +302,24 @@ const { source: l } = g[d], m = "entry" in l ? f[l.entry] : p[l.asset], P = "entry" in l ? "Entry" : "Asset"; | ||
return n; | ||
const S = r[m.space], A = s[m.environment], $ = m.id, w = c[l.field], N = u[l.locale], O = i[l.editorInterface], L = v[l.fieldType]; | ||
if (!(W(O.widgetNamespace) && !U(O.widgetId))) | ||
if (h.has(y, d)) { | ||
const M = h.get(y, d); | ||
if (M !== null) { | ||
const B = x({ | ||
entityId: $, | ||
entityType: P, | ||
space: S, | ||
environment: A, | ||
field: w, | ||
locale: N, | ||
editorInterface: O, | ||
fieldType: L, | ||
targetOrigin: t, | ||
platform: o | ||
}); | ||
C(L, M, B, y, d, g); | ||
} | ||
} else | ||
console.error(`Pointer ${d} not found in GraphQL data or href could not be generated.`); | ||
const S = r[m.space], A = s[m.environment], E = m.id, w = c[l.field], N = u[l.locale], O = i[l.editorInterface], L = v[l.fieldType]; | ||
if (!(W(O.widgetNamespace) && !U(O.widgetId)) && y.has(h, d)) { | ||
const M = y.get(h, d); | ||
if (M !== null) { | ||
const B = x({ | ||
entityId: E, | ||
entityType: P, | ||
space: S, | ||
environment: A, | ||
field: w, | ||
locale: N, | ||
editorInterface: O, | ||
fieldType: L, | ||
targetOrigin: t, | ||
platform: o | ||
}); | ||
C(L, M, B, h, d, g); | ||
} | ||
} | ||
} | ||
return n; | ||
}, E = (e, t, o, n, r) => { | ||
}, $ = (e, t, o, n, r) => { | ||
if (!e.fields) | ||
@@ -336,8 +334,8 @@ return; | ||
for (const c in i) { | ||
const { source: u } = i[c], f = e.sys.space.sys.id, p = e.sys.environment.sys.id, g = e.sys.id, v = e.sys.type, y = t[u.fieldType], d = o[u.editorInterface]; | ||
const { source: u } = i[c], f = e.sys.space.sys.id, p = e.sys.environment.sys.id, g = e.sys.id, v = e.sys.type, h = t[u.fieldType], d = o[u.editorInterface]; | ||
if (W(d.widgetNamespace) && !U(d.widgetId)) | ||
continue; | ||
const l = c.startsWith("/") ? c : `/${c}`; | ||
if (h.has(e, l)) { | ||
const m = h.get(e, l); | ||
if (y.has(e, l)) { | ||
const m = y.get(e, l); | ||
if (m === null) | ||
@@ -352,3 +350,3 @@ return; | ||
if (A) { | ||
const $ = x({ | ||
const E = x({ | ||
entityId: g, | ||
@@ -361,7 +359,7 @@ entityType: v, | ||
editorInterface: d, | ||
fieldType: y, | ||
fieldType: h, | ||
targetOrigin: n, | ||
platform: r | ||
}); | ||
C(y, m, $, e, l, i); | ||
C(h, m, E, e, l, i); | ||
} else | ||
@@ -377,3 +375,3 @@ Object.keys(m).forEach((w) => { | ||
editorInterface: d, | ||
fieldType: y, | ||
fieldType: h, | ||
targetOrigin: n, | ||
@@ -383,3 +381,3 @@ platform: r | ||
C( | ||
y, | ||
h, | ||
m, | ||
@@ -393,4 +391,3 @@ N, | ||
}); | ||
} else | ||
console.error("Pointer not found in the target", c, e); | ||
} | ||
} | ||
@@ -410,7 +407,7 @@ }, ue = (e, t, o) => { | ||
u.forEach( | ||
(p) => E(p, i, c, t, o) | ||
(p) => $(p, i, c, t, o) | ||
), f && f.Entry && f.Entry.forEach( | ||
(p) => E(p, i, c, t, o) | ||
(p) => $(p, i, c, t, o) | ||
), f && f.Asset && f.Asset.forEach( | ||
(p) => E(p, i, c, t, o) | ||
(p) => $(p, i, c, t, o) | ||
); | ||
@@ -421,3 +418,3 @@ } else { | ||
return console.error("Content source maps lookup data is missing"), s; | ||
E( | ||
$( | ||
s, | ||
@@ -424,0 +421,0 @@ s.sys.contentSourceMapsLookup.fieldTypes, |
{ | ||
"name": "@contentful/content-source-maps", | ||
"author": "Contentful GmbH", | ||
"version": "0.11.1", | ||
"version": "0.11.2", | ||
"description": "Base SDK for building Content Source Maps with Contentful", | ||
@@ -49,3 +49,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "8c62a4f099f9728067fe63a9585722220c934e67" | ||
"gitHead": "ba9244d8cdb0599e7c52b93add5cda80ac8d0074" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
108988
615