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

@contentful/live-preview

Package Overview
Dependencies
Maintainers
0
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.16 to 4.5.17

dist/index-BH_OaR7W.js

2

dist/index.js

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

import { C as t, I as o, L as a, c as n, e as E, V as i, u as r, a as p, f as I, o as d, p as R, b as L } from "./index-CHsPjn18.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-BH_OaR7W.js";
export {

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

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

import xe, { createContext as yr, useRef as N, useMemo as ee, useEffect as br, useState as hr, useContext as ke, useCallback as gr } from "react";
import { i as Er, C as re, d as Rr } from "./index-CHsPjn18.js";
var Q = { exports: {} }, W = {};
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 = {};
/**
* @license React
* react-jsx-runtime.production.min.js
* react-jsx-runtime.production.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
* Copyright (c) Meta Platforms, Inc. and affiliates.
*

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

*/
var Oe;
function _r() {
if (Oe) return W;
Oe = 1;
var u = xe, s = Symbol.for("react.element"), h = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, _ = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { 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) && !m.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: _.current };
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
};
}
return W.Fragment = h, W.jsx = C, W.jsxs = C, W;
return j.Fragment = a, j.jsx = i, j.jsxs = i, j;
}
var $ = {};
var k = {};
/**

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

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

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

*/
var je;
function mr() {
return je || (je = 1, process.env.NODE_ENV !== "production" && function() {
var u = xe, s = Symbol.for("react.element"), h = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), m = 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, De = "@@iterator";
function Ae(e) {
if (e === null || typeof e != "object")
return null;
var r = ne && e[ne] || e[De];
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];
Fe("error", e, t);
}
}
function Fe(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 Ie = !1, We = !1, $e = !1, Ye = !1, Le = !1, ae;
ae = Symbol.for("react.module.reference");
function Me(e) {
return !!(typeof e == "string" || typeof e == "function" || e === E || e === m || Le || e === _ || e === T || e === y || Ye || e === Y || Ie || We || $e || 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 Ue(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;
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;
switch (e) {
case E:
case $:
return "Fragment";
case h:
case Te:
return "Portal";
case m:
case D:
return "Profiler";
case _:
case K:
return "StrictMode";
case T:
case q:
return "Suspense";
case y:
case U:
return "SuspenseList";
}
if (typeof e == "object")
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 Ue(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;
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;
try {
return w(o(f));
return n(e(r));
} catch {
return null;
}
}
}
return null;
}
var O = Object.assign, A = 0, ie, ue, se, fe, le, ce, ve;
function de() {
function a(e) {
return "" + e;
}
de.__reactDisabledLog = !0;
function Ve() {
{
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++;
function i(e) {
try {
a(e);
var r = !1;
} catch {
r = !0;
}
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 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.");
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
});
}
R++;
}
var q = 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;
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 })
});
}
0 > R && console.error(
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
);
}
var J = !1, M;
{
var qe = typeof WeakMap == "function" ? WeakMap : Map;
M = new qe();
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;
}
function pe(e, r) {
if (!e || J)
return "";
{
var t = M.get(e);
if (t !== void 0)
return t;
}
var n;
J = !0;
var i = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var f;
f = q.current, q.current = null, Ve();
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();
try {
if (r) {
var o = function() {
throw Error();
};
if (Object.defineProperty(o.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
var f = {
DetermineComponentFrameRoot: function() {
try {
Reflect.construct(o, []);
} catch (g) {
n = g;
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(e, [], o);
} else {
try {
o.call();
} catch (g) {
n = g;
}
e.call(o.prototype);
return [null, null];
}
} 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)
};
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)
do
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;
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;
}
while (c >= 1 && v >= 0);
while (1 <= l && 0 <= o);
break;

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

} finally {
J = !1, q.current = f, Ne(), Error.prepareStackTrace = i;
H = !1, y.H = u, c(), Error.prepareStackTrace = t;
}
var D = e ? e.displayName || e.name : "", j = D ? L(D) : "";
return typeof e == "function" && M.set(e, j), j;
return v = (v = e ? e.displayName || e.name : "") ? E(v) : "", typeof e == "function" && L.set(e, v), v;
}
function Be(e, r, t) {
return pe(e, !1);
}
function Je(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, Je(e));
if (typeof e == "string")
return L(e);
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);
switch (e) {
case T:
return L("Suspense");
case y:
return L("SuspenseList");
case q:
return E("Suspense");
case U:
return E("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
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;
case W:
return e = b(e.render, !1), e;
case z:
return d(e.type);
case J:
r = e._payload, e = e._init;
try {
return U(f(i), r, t);
return d(e(r));
} catch {
}
}
}
return "";
}
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 p() {
var e = y.A;
return e === null ? null : e.getOwner();
}
function Ke(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 ze = Array.isArray;
function K(e) {
return ze(e);
}
function Ge(e) {
{
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
return t;
}
}
function Xe(e) {
try {
return he(e), !1;
} catch {
return !0;
}
}
function he(e) {
return "" + e;
}
function ge(e) {
if (Xe(e))
return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ge(e)), he(e);
}
var I = x.ReactCurrentOwner, He = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Ee, Re, z;
z = {};
function Ze(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 Qe(e) {
if (F.call(e, "key")) {
function O(e) {
if (oe.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 er(e, r) {
if (typeof e.ref == "string" && I.current && r && I.current.stateNode !== r) {
var t = w(I.current.type);
z[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), z[t] = !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
));
}
t.isReactWarning = !0, Object.defineProperty(e, "key", {
get: t,
configurable: !0
});
}
function rr(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 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() {
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 nr = 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
function ye(e, r, t, u, f, l) {
return t = l.ref, e = {
$$typeof: M,
type: e,
key: r,
ref: t,
props: o,
// Record the component responsible for creating this element.
props: l,
_owner: f
};
return a._store = {}, Object.defineProperty(a._store, "validated", {
}, (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", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(a, "_self", {
value: 0
}), Object.defineProperty(e, "_debugInfo", {
configurable: !1,
enumerable: !1,
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 ar(e, r, t, n, i) {
{
var f, o = {}, a = null, b = null;
t !== void 0 && (ge(t), a = "" + t), Qe(r) && (ge(r.key), a = "" + r.key), Ze(r) && (b = r.ref, er(r, i));
for (f in r)
F.call(r, f) && !He.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 && rr(o, v), b && tr(o, v);
}
return nr(e, a, b, i, n, I.current, o);
}
writable: !0,
value: null
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
}
var G = x.ReactCurrentOwner, _e = x.ReactDebugCurrentFrame;
function k(e) {
if (e) {
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
_e.setExtraStackFrame(t);
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);
} else
_e.setExtraStackFrame(null);
}
var X;
X = !1;
function H(e) {
return typeof e == "object" && e !== null && e.$$typeof === s;
}
function me() {
{
if (G.current) {
var e = w(G.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
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);
}
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 or(e) {
return "";
}
var Ce = {};
function ir(e) {
{
var r = me();
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 = ir(r);
if (Ce[t])
return;
Ce[t] = !0;
var n = "";
e && e._owner && e._owner !== G.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 (K(e))
function Z(e, r) {
if (typeof e == "object" && e && e.$$typeof !== ke) {
if (V(e))
for (var t = 0; t < e.length; t++) {
var n = e[t];
H(n) && Te(n, r);
var u = e[t];
Y(u) && Q(u, r);
}
else if (H(e))
e._store && (e._store.validated = !0);
else if (e) {
var i = Ae(e);
if (typeof i == "function" && i !== e.entries)
for (var f = i.call(e), o; !(o = f.next()).done; )
H(o.value) && Te(o.value, 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);
}
}
function ur(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);
Ke(t, e.props, "prop", n, e);
} else if (r.PropTypes !== void 0 && !X) {
X = !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 Y(e) {
return typeof e == "object" && e !== null && e.$$typeof === M;
}
function sr(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 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;
}
}
var we = {};
function Se(e, r, t, n, i, f) {
{
var o = Me(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 = or();
b ? a += b : a += me();
var c;
e === null ? c = "null" : K(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 = ar(e, r, t, i, f);
if (v == null)
return v;
if (o) {
var R = r.children;
if (R !== void 0)
if (n)
if (K(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(pr) {
return pr !== "key";
}), Z = g.length > 0 ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!we[j + Z]) {
var dr = 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} />`, Z, j, dr, j), we[j + Z] = !0;
}
}
return e === E ? sr(v) : ur(v), v;
}
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;
}
function fr(e, r, t) {
return Se(e, r, t, !0);
}
function lr(e, r, t) {
return Se(e, r, t, !1);
}
var cr = lr, vr = fr;
$.Fragment = E, $.jsx = cr, $.jsxs = vr;
}()), $;
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;
}
process.env.NODE_ENV === "production" ? Q.exports = _r() : Q.exports = mr();
var Cr = Q.exports;
function Tr(u) {
const s = N(u), h = N(0);
return Er(u, s.current) || (s.current = u, h.current += 1), ee(() => s.current, [h.current]);
var Ce;
function qe() {
return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? A.exports = $e() : A.exports = We()), A.exports;
}
function Pr(u, s) {
return br(u, Tr(s));
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]);
}
const te = yr(null);
function Or({
children: u,
locale: s,
space: h,
environment: E,
debugMode: _ = !1,
enableInspectorMode: m = !0,
enableLiveUpdates: C = !0,
targetOrigin: p,
experimental: l
function Je(n, a) {
return Ne(n, ze(a));
}
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
}) {
if (!s)
if (!a)
throw new Error(
'ContentfulLivePreviewProvider has to be called with a locale property (for example: `<ContentfulLivePreviewProvider locale="en-US">{children}</ContentfulLivePreviewProvider>`'
);
re.init({
locale: s,
space: h,
environment: E,
debugMode: _,
enableInspectorMode: m,
enableLiveUpdates: C,
targetOrigin: p,
experimental: l
B.init({
locale: a,
space: i,
environment: m,
debugMode: s,
enableInspectorMode: c,
enableLiveUpdates: E,
targetOrigin: b,
experimental: d
});
const T = ee(
const p = X(
() => ({
locale: s,
space: h,
environment: E,
debugMode: _,
enableInspectorMode: m,
enableLiveUpdates: C,
targetOrigin: p
locale: a,
space: i,
environment: m,
debugMode: s,
enableInspectorMode: c,
enableLiveUpdates: E,
targetOrigin: b
}),
[s, h, E, _, m, C, p]
[a, i, m, s, c, E, b]
);
return /* @__PURE__ */ Cr.jsx(te.Provider, { value: T, children: u });
return /* @__PURE__ */ Ue.jsx(F.Provider, { value: p, children: n });
}
function jr(u, s, h = !1) {
const [E, _] = hr({ data: u, version: 1 }), m = N(u), C = N(Rr(_)), p = ke(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 Pr(() => {
if (m.current !== u && (_({ data: u, version: 1 }), m.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 }));
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 }));
}
});
}, [u, T, l.locale, l.query]), E.data;
}, [n, p, d.locale, d.query]), m.data;
}
function xr(u) {
const s = ke(te);
return gr(
(h) => s != null && s.enableInspectorMode ? re.getProps({ ...u, ...h }) : null,
[s == null ? void 0 : s.enableInspectorMode, u]
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]
);
}
export {
Or as ContentfulLivePreviewProvider,
xr as useContentfulInspectorMode,
jr as useContentfulLiveUpdates,
Pr as useDeepCompareEffectNoCheck,
Tr as useDeepCompareMemoize
He as ContentfulLivePreviewProvider,
Xe as useContentfulInspectorMode,
Le as useContentfulLiveUpdates,
Je as useDeepCompareEffectNoCheck,
ze as useDeepCompareMemoize
};
//# sourceMappingURL=react.js.map
{
"name": "@contentful/live-preview",
"version": "4.5.16",
"version": "4.5.17",
"author": "Contentful GmbH",

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

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

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