Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contentful/live-preview

Package Overview
Dependencies
Maintainers
4
Versions
218
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contentful/live-preview - npm Package Compare versions

Comparing version 4.5.17 to 4.5.18

dist/index-BQlezUIC.cjs

2

dist/index.js

@@ -1,2 +0,2 @@

import { C as t, I as o, L as a, b as n, c as E, V as i, f as r, u as p, e as I, o as d, p as R, a as L } from "./index-BH_OaR7W.js";
import { C as t, I as o, L as a, b as n, c as E, V as i, f as r, u as p, e as I, o as d, p as R, a as L } from "./index-DOTA3foM.js";
export {

@@ -3,0 +3,0 @@ t as ContentfulLivePreview,

@@ -1,9 +0,9 @@

import Se, { createContext as Ae, useRef as N, useMemo as X, useEffect as Ne, useState as Oe, useContext as pe, useCallback as Pe } from "react";
import { i as Ye, C as B, d as Me } from "./index-BH_OaR7W.js";
var A = { exports: {} }, j = {};
import ke, { createContext as br, useRef as N, useMemo as ee, useEffect as hr, useState as gr, useContext as De, useCallback as Er } from "react";
import { i as Rr, C as re, d as mr } from "./index-DOTA3foM.js";
var q = { exports: {} }, W = {};
/**
* @license React
* react-jsx-runtime.production.js
* react-jsx-runtime.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* Copyright (c) Facebook, Inc. and its affiliates.
*

@@ -13,25 +13,17 @@ * This source code is licensed under the MIT license found in the

*/
var me;
function $e() {
if (me) return j;
me = 1;
var n = Symbol.for("react.transitional.element"), a = Symbol.for("react.fragment");
function i(m, s, c) {
var E = null;
if (c !== void 0 && (E = "" + c), s.key !== void 0 && (E = "" + s.key), "key" in s) {
c = {};
for (var b in s)
b !== "key" && (c[b] = s[b]);
} else c = s;
return s = c.ref, {
$$typeof: n,
type: m,
key: E,
ref: s !== void 0 ? s : null,
props: c
};
var Oe;
function _r() {
if (Oe) return W;
Oe = 1;
var u = ke, s = Symbol.for("react.element"), h = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, m = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, _ = { key: !0, ref: !0, __self: !0, __source: !0 };
function C(p, l, T) {
var y, P = {}, S = null, Y = null;
T !== void 0 && (S = "" + T), l.key !== void 0 && (S = "" + l.key), l.ref !== void 0 && (Y = l.ref);
for (y in l) E.call(l, y) && !_.hasOwnProperty(y) && (P[y] = l[y]);
if (p && p.defaultProps) for (y in l = p.defaultProps, l) P[y] === void 0 && (P[y] = l[y]);
return { $$typeof: s, type: p, key: S, ref: Y, props: P, _owner: m.current };
}
return j.Fragment = a, j.jsx = i, j.jsxs = i, j;
return W.Fragment = h, W.jsx = C, W.jsxs = C, W;
}
var k = {};
var $ = {};
/**

@@ -41,3 +33,3 @@ * @license React

*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* Copyright (c) Facebook, Inc. and its affiliates.
*

@@ -47,207 +39,237 @@ * This source code is licensed under the MIT license found in the

*/
var ge;
function We() {
return ge || (ge = 1, process.env.NODE_ENV !== "production" && function() {
function n(e) {
if (e == null) return null;
if (typeof e == "function")
return e.$$typeof === he ? null : e.displayName || e.name || null;
if (typeof e == "string") return e;
var je;
function Cr() {
return je || (je = 1, process.env.NODE_ENV !== "production" && function() {
var u = ke, s = Symbol.for("react.element"), h = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), C = Symbol.for("react.provider"), p = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), Y = Symbol.for("react.offscreen"), ne = Symbol.iterator, Ae = "@@iterator";
function Fe(e) {
if (e === null || typeof e != "object")
return null;
var r = ne && e[ne] || e[Ae];
return typeof r == "function" ? r : null;
}
var x = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function d(e) {
{
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
t[n - 1] = arguments[n];
Ie("error", e, t);
}
}
function Ie(e, r, t) {
{
var n = x.ReactDebugCurrentFrame, i = n.getStackAddendum();
i !== "" && (r += "%s", t = t.concat([i]));
var f = t.map(function(o) {
return String(o);
});
f.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, f);
}
}
var We = !1, $e = !1, Ye = !1, Le = !1, Me = !1, ae;
ae = Symbol.for("react.module.reference");
function Ue(e) {
return !!(typeof e == "string" || typeof e == "function" || e === E || e === _ || Me || e === m || e === T || e === y || Le || e === Y || We || $e || Ye || typeof e == "object" && e !== null && (e.$$typeof === S || e.$$typeof === P || e.$$typeof === C || e.$$typeof === p || e.$$typeof === l || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
e.$$typeof === ae || e.getModuleId !== void 0));
}
function Ve(e, r, t) {
var n = e.displayName;
if (n)
return n;
var i = r.displayName || r.name || "";
return i !== "" ? t + "(" + i + ")" : t;
}
function oe(e) {
return e.displayName || "Context";
}
function w(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
return e.displayName || e.name || null;
if (typeof e == "string")
return e;
switch (e) {
case $:
case E:
return "Fragment";
case Te:
case h:
return "Portal";
case D:
case _:
return "Profiler";
case K:
case m:
return "StrictMode";
case q:
case T:
return "Suspense";
case U:
case y:
return "SuspenseList";
}
if (typeof e == "object")
switch (typeof e.tag == "number" && console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
), e.$$typeof) {
case re:
return (e.displayName || "Context") + ".Provider";
case ee:
return (e._context.displayName || "Context") + ".Consumer";
case W:
var r = e.render;
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
case z:
return r = e.displayName || null, r !== null ? r : n(e.type) || "Memo";
case J:
r = e._payload, e = e._init;
switch (e.$$typeof) {
case p:
var r = e;
return oe(r) + ".Consumer";
case C:
var t = e;
return oe(t._context) + ".Provider";
case l:
return Ve(e, e.render, "ForwardRef");
case P:
var n = e.displayName || null;
return n !== null ? n : w(e.type) || "Memo";
case S: {
var i = e, f = i._payload, o = i._init;
try {
return n(e(r));
return w(o(f));
} catch {
return null;
}
}
}
return null;
}
function a(e) {
return "" + e;
var O = Object.assign, A = 0, ie, ue, se, fe, le, ce, ve;
function de() {
}
function i(e) {
try {
a(e);
var r = !1;
} catch {
r = !0;
de.__reactDisabledLog = !0;
function qe() {
{
if (A === 0) {
ie = console.log, ue = console.info, se = console.warn, fe = console.error, le = console.group, ce = console.groupCollapsed, ve = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: de,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
}
A++;
}
if (r) {
r = console;
var t = r.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
return t.call(
r,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
u
), a(e);
}
}
function m() {
}
function s() {
if (R === 0) {
ne = console.log, ue = console.info, ae = console.warn, le = console.error, se = console.group, ie = console.groupCollapsed, ce = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: m,
writable: !0
};
Object.defineProperties(console, {
info: e,
log: e,
warn: e,
error: e,
group: e,
groupCollapsed: e,
groupEnd: e
});
function Ne() {
{
if (A--, A === 0) {
var e = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: O({}, e, {
value: ie
}),
info: O({}, e, {
value: ue
}),
warn: O({}, e, {
value: se
}),
error: O({}, e, {
value: fe
}),
group: O({}, e, {
value: le
}),
groupCollapsed: O({}, e, {
value: ce
}),
groupEnd: O({}, e, {
value: ve
})
});
}
A < 0 && d("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
R++;
}
function c() {
if (R--, R === 0) {
var e = { configurable: !0, enumerable: !0, writable: !0 };
Object.defineProperties(console, {
log: _({}, e, { value: ne }),
info: _({}, e, { value: ue }),
warn: _({}, e, { value: ae }),
error: _({}, e, { value: le }),
group: _({}, e, { value: se }),
groupCollapsed: _({}, e, { value: ie }),
groupEnd: _({}, e, { value: ce })
});
var J = x.ReactCurrentDispatcher, B;
function L(e, r, t) {
{
if (B === void 0)
try {
throw Error();
} catch (i) {
var n = i.stack.trim().match(/\n( *(at )?)/);
B = n && n[1] || "";
}
return `
` + B + e;
}
0 > R && console.error(
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
);
}
function E(e) {
if (G === void 0)
try {
throw Error();
} catch (t) {
var r = t.stack.trim().match(/\n( *(at )?)/);
G = r && r[1] || "", fe = -1 < t.stack.indexOf(`
at`) ? " (<anonymous>)" : -1 < t.stack.indexOf("@") ? "@unknown:0:0" : "";
}
return `
` + G + e + fe;
var K = !1, M;
{
var Je = typeof WeakMap == "function" ? WeakMap : Map;
M = new Je();
}
function b(e, r) {
if (!e || H) return "";
var t = L.get(e);
if (t !== void 0) return t;
H = !0, t = Error.prepareStackTrace, Error.prepareStackTrace = void 0;
var u = null;
u = y.H, y.H = null, s();
function pe(e, r) {
if (!e || K)
return "";
{
var t = M.get(e);
if (t !== void 0)
return t;
}
var n;
K = !0;
var i = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var f;
f = J.current, J.current = null, qe();
try {
var f = {
DetermineComponentFrameRoot: function() {
if (r) {
var o = function() {
throw Error();
};
if (Object.defineProperty(o.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
if (r) {
var w = function() {
throw Error();
};
if (Object.defineProperty(w.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(w, []);
} catch (C) {
var S = C;
}
Reflect.construct(e, [], w);
} else {
try {
w.call();
} catch (C) {
S = C;
}
e.call(w.prototype);
}
} else {
try {
throw Error();
} catch (C) {
S = C;
}
(w = e()) && typeof w.catch == "function" && w.catch(function() {
});
}
} catch (C) {
if (C && S && typeof C.stack == "string")
return [C.stack, S.stack];
Reflect.construct(o, []);
} catch (g) {
n = g;
}
return [null, null];
Reflect.construct(e, [], o);
} else {
try {
o.call();
} catch (g) {
n = g;
}
e.call(o.prototype);
}
};
f.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
var l = Object.getOwnPropertyDescriptor(
f.DetermineComponentFrameRoot,
"name"
);
l && l.configurable && Object.defineProperty(
f.DetermineComponentFrameRoot,
"name",
{ value: "DetermineComponentFrameRoot" }
);
var o = f.DetermineComponentFrameRoot(), g = o[0], T = o[1];
if (g && T) {
var v = g.split(`
`), x = T.split(`
`);
for (o = l = 0; l < v.length && !v[l].includes(
"DetermineComponentFrameRoot"
); )
l++;
for (; o < x.length && !x[o].includes(
"DetermineComponentFrameRoot"
); )
o++;
if (l === v.length || o === x.length)
for (l = v.length - 1, o = x.length - 1; 1 <= l && 0 <= o && v[l] !== x[o]; )
o--;
for (; 1 <= l && 0 <= o; l--, o--)
if (v[l] !== x[o]) {
if (l !== 1 || o !== 1)
} else {
try {
throw Error();
} catch (g) {
n = g;
}
e();
}
} catch (g) {
if (g && n && typeof g.stack == "string") {
for (var a = g.stack.split(`
`), b = n.stack.split(`
`), c = a.length - 1, v = b.length - 1; c >= 1 && v >= 0 && a[c] !== b[v]; )
v--;
for (; c >= 1 && v >= 0; c--, v--)
if (a[c] !== b[v]) {
if (c !== 1 || v !== 1)
do
if (l--, o--, 0 > o || v[l] !== x[o]) {
var h = `
` + v[l].replace(
" at new ",
" at "
);
return e.displayName && h.includes("<anonymous>") && (h = h.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, h), h;
if (c--, v--, v < 0 || a[c] !== b[v]) {
var R = `
` + a[c].replace(" at new ", " at ");
return e.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, R), R;
}
while (1 <= l && 0 <= o);
while (c >= 1 && v >= 0);
break;

@@ -257,267 +279,437 @@ }

} finally {
H = !1, y.H = u, c(), Error.prepareStackTrace = t;
K = !1, J.current = f, Ne(), Error.prepareStackTrace = i;
}
return v = (v = e ? e.displayName || e.name : "") ? E(v) : "", typeof e == "function" && L.set(e, v), v;
var D = e ? e.displayName || e.name : "", j = D ? L(D) : "";
return typeof e == "function" && M.set(e, j), j;
}
function d(e) {
if (e == null) return "";
if (typeof e == "function") {
var r = e.prototype;
return b(
e,
!(!r || !r.isReactComponent)
);
}
if (typeof e == "string") return E(e);
function Be(e, r, t) {
return pe(e, !1);
}
function Ke(e) {
var r = e.prototype;
return !!(r && r.isReactComponent);
}
function U(e, r, t) {
if (e == null)
return "";
if (typeof e == "function")
return pe(e, Ke(e));
if (typeof e == "string")
return L(e);
switch (e) {
case q:
return E("Suspense");
case U:
return E("SuspenseList");
case T:
return L("Suspense");
case y:
return L("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case W:
return e = b(e.render, !1), e;
case z:
return d(e.type);
case J:
r = e._payload, e = e._init;
case l:
return Be(e.render);
case P:
return U(e.type, r, t);
case S: {
var n = e, i = n._payload, f = n._init;
try {
return d(e(r));
return U(f(i), r, t);
} catch {
}
}
}
return "";
}
function p() {
var e = y.A;
return e === null ? null : e.getOwner();
var F = Object.prototype.hasOwnProperty, ye = {}, be = x.ReactDebugCurrentFrame;
function V(e) {
if (e) {
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
be.setExtraStackFrame(t);
} else
be.setExtraStackFrame(null);
}
function O(e) {
if (oe.call(e, "key")) {
function ze(e, r, t, n, i) {
{
var f = Function.call.bind(F);
for (var o in e)
if (f(e, o)) {
var a = void 0;
try {
if (typeof e[o] != "function") {
var b = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw b.name = "Invariant Violation", b;
}
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (c) {
a = c;
}
a && !(a instanceof Error) && (V(i), d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), V(null)), a instanceof Error && !(a.message in ye) && (ye[a.message] = !0, V(i), d("Failed %s type: %s", t, a.message), V(null));
}
}
}
var Ge = Array.isArray;
function z(e) {
return Ge(e);
}
function Xe(e) {
{
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
return t;
}
}
function He(e) {
try {
return he(e), !1;
} catch {
return !0;
}
}
function he(e) {
return "" + e;
}
function ge(e) {
if (He(e))
return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Xe(e)), he(e);
}
var I = x.ReactCurrentOwner, Ze = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Ee, Re, G;
G = {};
function Qe(e) {
if (F.call(e, "ref")) {
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
if (r && r.isReactWarning)
return !1;
}
return e.ref !== void 0;
}
function er(e) {
if (F.call(e, "key")) {
var r = Object.getOwnPropertyDescriptor(e, "key").get;
if (r && r.isReactWarning) return !1;
if (r && r.isReactWarning)
return !1;
}
return e.key !== void 0;
}
function P(e, r) {
function t() {
ve || (ve = !0, console.error(
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
r
));
function rr(e, r) {
if (typeof e.ref == "string" && I.current && r && I.current.stateNode !== r) {
var t = w(I.current.type);
G[t] || (d('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', w(I.current.type), e.ref), G[t] = !0);
}
t.isReactWarning = !0, Object.defineProperty(e, "key", {
get: t,
configurable: !0
});
}
function we() {
var e = n(this.type);
return Ee[e] || (Ee[e] = !0, console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
)), e = this.props.ref, e !== void 0 ? e : null;
function tr(e, r) {
{
var t = function() {
Ee || (Ee = !0, d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
};
t.isReactWarning = !0, Object.defineProperty(e, "key", {
get: t,
configurable: !0
});
}
}
function ye(e, r, t, u, f, l) {
return t = l.ref, e = {
$$typeof: M,
function nr(e, r) {
{
var t = function() {
Re || (Re = !0, d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
};
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
get: t,
configurable: !0
});
}
}
var ar = function(e, r, t, n, i, f, o) {
var a = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: s,
// Built-in properties that belong on the element
type: e,
key: r,
props: l,
ref: t,
props: o,
// Record the component responsible for creating this element.
_owner: f
}, (t !== void 0 ? t : null) !== null ? Object.defineProperty(e, "ref", {
enumerable: !1,
get: we
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
};
return a._store = {}, Object.defineProperty(a._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: 0
}), Object.defineProperty(e, "_debugInfo", {
value: !1
}), Object.defineProperty(a, "_self", {
configurable: !1,
enumerable: !1,
writable: !0,
value: null
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
writable: !1,
value: n
}), Object.defineProperty(a, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: i
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
};
function or(e, r, t, n, i) {
{
var f, o = {}, a = null, b = null;
t !== void 0 && (ge(t), a = "" + t), er(r) && (ge(r.key), a = "" + r.key), Qe(r) && (b = r.ref, rr(r, i));
for (f in r)
F.call(r, f) && !Ze.hasOwnProperty(f) && (o[f] = r[f]);
if (e && e.defaultProps) {
var c = e.defaultProps;
for (f in c)
o[f] === void 0 && (o[f] = c[f]);
}
if (a || b) {
var v = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
a && tr(o, v), b && nr(o, v);
}
return ar(e, a, b, i, n, I.current, o);
}
}
function I(e, r, t, u, f, l) {
if (typeof e == "string" || typeof e == "function" || e === $ || e === D || e === K || e === q || e === U || e === Re || typeof e == "object" && e !== null && (e.$$typeof === J || e.$$typeof === z || e.$$typeof === re || e.$$typeof === ee || e.$$typeof === W || e.$$typeof === je || e.getModuleId !== void 0)) {
var o = r.children;
if (o !== void 0)
if (u)
if (V(o)) {
for (u = 0; u < o.length; u++)
Z(o[u], e);
Object.freeze && Object.freeze(o);
} else
console.error(
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
);
else Z(o, e);
var X = x.ReactCurrentOwner, me = x.ReactDebugCurrentFrame;
function k(e) {
if (e) {
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
me.setExtraStackFrame(t);
} else
o = "", (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), e === null ? u = "null" : V(e) ? u = "array" : e !== void 0 && e.$$typeof === M ? (u = "<" + (n(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : u = typeof e, console.error(
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
u,
o
);
if (oe.call(r, "key")) {
o = n(e);
var g = Object.keys(r).filter(function(v) {
return v !== "key";
});
u = 0 < g.length ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}", be[o + u] || (g = 0 < g.length ? "{" + g.join(": ..., ") + ": ...}" : "{}", console.error(
`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,
u,
o,
g,
o
), be[o + u] = !0);
me.setExtraStackFrame(null);
}
var H;
H = !1;
function Z(e) {
return typeof e == "object" && e !== null && e.$$typeof === s;
}
function _e() {
{
if (X.current) {
var e = w(X.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
if (o = null, t !== void 0 && (i(t), o = "" + t), O(r) && (i(r.key), o = "" + r.key), "key" in r) {
t = {};
for (var T in r)
T !== "key" && (t[T] = r[T]);
} else t = r;
return o && P(
t,
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
), ye(e, o, l, f, p(), t);
}
function Z(e, r) {
if (typeof e == "object" && e && e.$$typeof !== ke) {
if (V(e))
function ir(e) {
return "";
}
var Ce = {};
function ur(e) {
{
var r = _e();
if (!r) {
var t = typeof e == "string" ? e : e.displayName || e.name;
t && (r = `
Check the top-level render call using <` + t + ">.");
}
return r;
}
}
function Te(e, r) {
{
if (!e._store || e._store.validated || e.key != null)
return;
e._store.validated = !0;
var t = ur(r);
if (Ce[t])
return;
Ce[t] = !0;
var n = "";
e && e._owner && e._owner !== X.current && (n = " It was passed a child from " + w(e._owner.type) + "."), k(e), d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), k(null);
}
}
function Pe(e, r) {
{
if (typeof e != "object")
return;
if (z(e))
for (var t = 0; t < e.length; t++) {
var u = e[t];
Y(u) && Q(u, r);
var n = e[t];
Z(n) && Te(n, r);
}
else if (Y(e))
e._store && (e._store.validated = 1);
else if (e === null || typeof e != "object" ? t = null : (t = te && e[te] || e["@@iterator"], t = typeof t == "function" ? t : null), typeof t == "function" && t !== e.entries && (t = t.call(e), t !== e))
for (; !(e = t.next()).done; )
Y(e.value) && Q(e.value, r);
else if (Z(e))
e._store && (e._store.validated = !0);
else if (e) {
var i = Fe(e);
if (typeof i == "function" && i !== e.entries)
for (var f = i.call(e), o; !(o = f.next()).done; )
Z(o.value) && Te(o.value, r);
}
}
}
function Y(e) {
return typeof e == "object" && e !== null && e.$$typeof === M;
function sr(e) {
{
var r = e.type;
if (r == null || typeof r == "string")
return;
var t;
if (typeof r == "function")
t = r.propTypes;
else if (typeof r == "object" && (r.$$typeof === l || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
r.$$typeof === P))
t = r.propTypes;
else
return;
if (t) {
var n = w(r);
ze(t, e.props, "prop", n, e);
} else if (r.PropTypes !== void 0 && !H) {
H = !0;
var i = w(r);
d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
}
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function Q(e, r) {
if (e._store && !e._store.validated && e.key == null && (e._store.validated = 1, r = _e(r), !de[r])) {
de[r] = !0;
var t = "";
e && e._owner != null && e._owner !== p() && (t = null, typeof e._owner.tag == "number" ? t = n(e._owner.type) : typeof e._owner.name == "string" && (t = e._owner.name), t = " It was passed a child from " + t + ".");
var u = y.getCurrentStack;
y.getCurrentStack = function() {
var f = d(e.type);
return u && (f += u() || ""), f;
}, console.error(
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
r,
t
), y.getCurrentStack = u;
function fr(e) {
{
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
var n = r[t];
if (n !== "children" && n !== "key") {
k(e), d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), k(null);
break;
}
}
e.ref !== null && (k(e), d("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
}
}
function _e(e) {
var r = "", t = p();
return t && (t = n(t.type)) && (r = `
Check the render method of \`` + t + "`."), r || (e = n(e)) && (r = `
Check the top-level render call using <` + e + ">."), r;
var we = {};
function Se(e, r, t, n, i, f) {
{
var o = Ue(e);
if (!o) {
var a = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var b = ir();
b ? a += b : a += _e();
var c;
e === null ? c = "null" : z(e) ? c = "array" : e !== void 0 && e.$$typeof === s ? (c = "<" + (w(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : c = typeof e, d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, a);
}
var v = or(e, r, t, i, f);
if (v == null)
return v;
if (o) {
var R = r.children;
if (R !== void 0)
if (n)
if (z(R)) {
for (var D = 0; D < R.length; D++)
Pe(R[D], e);
Object.freeze && Object.freeze(R);
} else
d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
Pe(R, e);
}
if (F.call(r, "key")) {
var j = w(e), g = Object.keys(r).filter(function(yr) {
return yr !== "key";
}), Q = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!we[j + Q]) {
var pr = g.length > 0 ? "{" + g.join(": ..., ") + ": ...}" : "{}";
d(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`, Q, j, pr, j), we[j + Q] = !0;
}
}
return e === E ? fr(v) : sr(v), v;
}
}
var xe = Se, M = Symbol.for("react.transitional.element"), Te = Symbol.for("react.portal"), $ = Symbol.for("react.fragment"), K = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), ee = Symbol.for("react.consumer"), re = Symbol.for("react.context"), W = Symbol.for("react.forward_ref"), q = Symbol.for("react.suspense"), U = Symbol.for("react.suspense_list"), z = Symbol.for("react.memo"), J = Symbol.for("react.lazy"), Re = Symbol.for("react.offscreen"), te = Symbol.iterator, he = Symbol.for("react.client.reference"), y = xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, oe = Object.prototype.hasOwnProperty, _ = Object.assign, je = Symbol.for("react.client.reference"), V = Array.isArray, R = 0, ne, ue, ae, le, se, ie, ce;
m.__reactDisabledLog = !0;
var G, fe, H = !1, L = new (typeof WeakMap == "function" ? WeakMap : Map)(), ke = Symbol.for("react.client.reference"), ve, Ee = {}, be = {}, de = {};
k.Fragment = $, k.jsx = function(e, r, t, u, f) {
return I(e, r, t, !1, u, f);
}, k.jsxs = function(e, r, t, u, f) {
return I(e, r, t, !0, u, f);
};
}()), k;
function lr(e, r, t) {
return Se(e, r, t, !0);
}
function cr(e, r, t) {
return Se(e, r, t, !1);
}
var vr = cr, dr = lr;
$.Fragment = E, $.jsx = vr, $.jsxs = dr;
}()), $;
}
var Ce;
function qe() {
return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? A.exports = $e() : A.exports = We()), A.exports;
var xe;
function Tr() {
return xe || (xe = 1, process.env.NODE_ENV === "production" ? q.exports = _r() : q.exports = Cr()), q.exports;
}
var Ue = qe();
function ze(n) {
const a = N(n), i = N(0);
return Ye(n, a.current) || (a.current = n, i.current += 1), X(() => a.current, [i.current]);
var Pr = Tr();
function wr(u) {
const s = N(u), h = N(0);
return Rr(u, s.current) || (s.current = u, h.current += 1), ee(() => s.current, [h.current]);
}
function Je(n, a) {
return Ne(n, ze(a));
function Sr(u, s) {
return hr(u, wr(s));
}
const F = Ae(null);
function He({
children: n,
locale: a,
space: i,
environment: m,
debugMode: s = !1,
enableInspectorMode: c = !0,
enableLiveUpdates: E = !0,
targetOrigin: b,
experimental: d
const te = br(null);
function xr({
children: u,
locale: s,
space: h,
environment: E,
debugMode: m = !1,
enableInspectorMode: _ = !0,
enableLiveUpdates: C = !0,
targetOrigin: p,
experimental: l
}) {
if (!a)
if (!s)
throw new Error(
'ContentfulLivePreviewProvider has to be called with a locale property (for example: `<ContentfulLivePreviewProvider locale="en-US">{children}</ContentfulLivePreviewProvider>`'
);
B.init({
locale: a,
space: i,
environment: m,
debugMode: s,
enableInspectorMode: c,
enableLiveUpdates: E,
targetOrigin: b,
experimental: d
re.init({
locale: s,
space: h,
environment: E,
debugMode: m,
enableInspectorMode: _,
enableLiveUpdates: C,
targetOrigin: p,
experimental: l
});
const p = X(
const T = ee(
() => ({
locale: a,
space: i,
environment: m,
debugMode: s,
enableInspectorMode: c,
enableLiveUpdates: E,
targetOrigin: b
locale: s,
space: h,
environment: E,
debugMode: m,
enableInspectorMode: _,
enableLiveUpdates: C,
targetOrigin: p
}),
[a, i, m, s, c, E, b]
[s, h, E, m, _, C, p]
);
return /* @__PURE__ */ Ue.jsx(F.Provider, { value: p, children: n });
return /* @__PURE__ */ Pr.jsx(te.Provider, { value: T, children: u });
}
function Le(n, a, i = !1) {
const [m, s] = Oe({ data: n, version: 1 }), c = N(n), E = N(Me(s)), b = pe(F), d = typeof a == "object" ? a : { locale: a, skip: i }, p = X(() => b && !b.enableLiveUpdates || d.skip ? !1 : !!(Array.isArray(n) && n.length || n && typeof n == "object" && Object.keys(n).length), [b, d.skip, n]);
return Je(() => {
if (c.current !== n && (s({ data: n, version: 1 }), c.current = n), !!p)
return B.subscribe("edit", {
data: n,
locale: d.locale,
query: d.query,
callback: (O) => {
E.current((P) => ({ data: O, version: P.version + 1 }));
function kr(u, s, h = !1) {
const [E, m] = gr({ data: u, version: 1 }), _ = N(u), C = N(mr(m)), p = De(te), l = typeof s == "object" ? s : { locale: s, skip: h }, T = ee(() => p && !p.enableLiveUpdates || l.skip ? !1 : !!(Array.isArray(u) && u.length || u && typeof u == "object" && Object.keys(u).length), [p, l.skip, u]);
return Sr(() => {
if (_.current !== u && (m({ data: u, version: 1 }), _.current = u), !!T)
return re.subscribe("edit", {
data: u,
locale: l.locale,
query: l.query,
callback: (y) => {
C.current((P) => ({ data: y, version: P.version + 1 }));
}
});
}, [n, p, d.locale, d.query]), m.data;
}, [u, T, l.locale, l.query]), E.data;
}
function Xe(n) {
const a = pe(F);
return Pe(
(i) => a != null && a.enableInspectorMode ? B.getProps({ ...n, ...i }) : null,
[a == null ? void 0 : a.enableInspectorMode, n]
function Dr(u) {
const s = De(te);
return Er(
(h) => s != null && s.enableInspectorMode ? re.getProps({ ...u, ...h }) : null,
[s == null ? void 0 : s.enableInspectorMode, u]
);
}
export {
He as ContentfulLivePreviewProvider,
Xe as useContentfulInspectorMode,
Le as useContentfulLiveUpdates,
Je as useDeepCompareEffectNoCheck,
ze as useDeepCompareMemoize
xr as ContentfulLivePreviewProvider,
Dr as useContentfulInspectorMode,
kr as useContentfulLiveUpdates,
Sr as useDeepCompareEffectNoCheck,
wr as useDeepCompareMemoize
};
//# sourceMappingURL=react.js.map
{
"name": "@contentful/live-preview",
"version": "4.5.17",
"version": "4.5.18",
"author": "Contentful GmbH",

@@ -67,11 +67,11 @@ "license": "MIT",

"jsdom": "^25.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"type-fest": "^4.23.0"
},
"peerDependencies": {
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
},
"gitHead": "56c206e3240e360b2a5c790a59cf2ae4dbfda708"
"gitHead": "01a425ac420348b0bcb68182cc854e74d300ec28"
}

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc