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

@splinetool/react-spline

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@splinetool/react-spline - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

1145

dist/react-spline.js

@@ -1,13 +0,13 @@

"use client";import Ue, { forwardRef as Ne, useRef as ce, useState as Ve, useMemo as Er, useEffect as Be } from "react";
import { Application as Rr } from "@splinetool/runtime";
var Q = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function _r(n) {
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
"use client";import dr, { forwardRef as Ne, useRef as ce, useState as We, useMemo as vr, useEffect as Me } from "react";
import { Application as pr } from "@splinetool/runtime";
var re = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function mr(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
var le = { exports: {} }, q = {};
var de = { exports: {} }, q = {};
/**
* @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.
*

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

*/
var $e;
function Tr() {
if ($e)
var Fe;
function br() {
if (Fe)
return q;
$e = 1;
var n = Ue, f = Symbol.for("react.element"), b = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, R = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, C = { key: !0, ref: !0, __self: !0, __source: !0 };
function _(d, c, T) {
var v, m = {}, O = null, P = null;
T !== void 0 && (O = "" + T), c.key !== void 0 && (O = "" + c.key), c.ref !== void 0 && (P = c.ref);
for (v in c)
E.call(c, v) && !C.hasOwnProperty(v) && (m[v] = c[v]);
if (d && d.defaultProps)
for (v in c = d.defaultProps, c)
m[v] === void 0 && (m[v] = c[v]);
return { $$typeof: f, type: d, key: O, ref: P, props: m, _owner: R.current };
Fe = 1;
var t = Symbol.for("react.transitional.element"), i = Symbol.for("react.fragment");
function f(R, u, p) {
var y = null;
if (p !== void 0 && (y = "" + p), u.key !== void 0 && (y = "" + u.key), "key" in u) {
p = {};
for (var l in u)
l !== "key" && (p[l] = u[l]);
} else
p = u;
return u = p.ref, {
$$typeof: t,
type: R,
key: y,
ref: u !== void 0 ? u : null,
props: p
};
}
return q.Fragment = b, q.jsx = _, q.jsxs = _, q;
return q.Fragment = i, q.jsx = f, q.jsxs = f, q;
}
var J = {};
var X = {};
/**

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

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

@@ -47,87 +53,82 @@ * This source code is licensed under the MIT license found in the

*/
var Le;
function Sr() {
return Le || (Le = 1, process.env.NODE_ENV !== "production" && function() {
var n = Ue, f = Symbol.for("react.element"), b = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), _ = Symbol.for("react.provider"), d = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), P = Symbol.for("react.offscreen"), F = Symbol.iterator, I = "@@iterator";
function k(e) {
var Ie;
function yr() {
return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
var t = dr, i = !1, f = !1, R = !1, u = !0, p = !0, y = !1, l = Symbol.for("react.transitional.element"), C = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), A = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), Y = Symbol.for("react.provider"), D = Symbol.for("react.consumer"), P = Symbol.for("react.context"), w = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), h = Symbol.iterator, s = "@@iterator";
function N(e) {
if (e === null || typeof e != "object")
return null;
var r = F && e[F] || e[I];
var r = h && e[h] || e[s];
return typeof r == "function" ? r : null;
}
var g = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function u(e) {
var O = t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
function x(e) {
{
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)
t[a - 1] = arguments[a];
$("error", e, t);
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++)
n[a - 1] = arguments[a];
Ye("error", e, n);
}
}
function $(e, r, t) {
function Ye(e, r, n) {
{
var a = g.ReactDebugCurrentFrame, s = a.getStackAddendum();
s !== "" && (r += "%s", t = t.concat([s]));
var l = t.map(function(o) {
return String(o);
var a = O.getStackAddendum();
a !== "" && (r += "%s", n = n.concat([a]));
var o = n.map(function(d) {
return String(d);
});
l.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, l);
o.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, o);
}
}
var x = !1, S = !1, p = !1, D = !1, L = !1, V;
V = Symbol.for("react.module.reference");
function ze(e) {
return !!(typeof e == "string" || typeof e == "function" || e === E || e === C || L || e === R || e === T || e === v || D || e === P || x || S || p || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === m || e.$$typeof === _ || e.$$typeof === d || e.$$typeof === c || // 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 === V || e.getModuleId !== void 0));
}
function Ke(e, r, t) {
function Ue(e, r, n) {
var a = e.displayName;
if (a)
return a;
var s = r.displayName || r.name || "";
return s !== "" ? t + "(" + s + ")" : t;
var o = r.displayName || r.name || "";
return o !== "" ? n + "(" + o + ")" : n;
}
function pe(e) {
function me(e) {
return e.displayName || "Context";
}
function W(e) {
var Le = Symbol.for("react.client.reference");
function z(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && u("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 == "function")
return e.$$typeof === Le ? null : e.displayName || e.name || null;
if (typeof e == "string")
return e;
switch (e) {
case E:
case S:
return "Fragment";
case b:
case C:
return "Portal";
case C:
case T:
return "Profiler";
case R:
case A:
return "StrictMode";
case T:
case j:
return "Suspense";
case v:
case E:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case d:
switch (typeof e.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
case Y:
return null;
case P:
var r = e;
return pe(r) + ".Consumer";
case _:
var t = e;
return pe(t._context) + ".Provider";
case c:
return Ke(e, e.render, "ForwardRef");
return me(r) + ".Provider";
case D: {
var n = e;
return me(n._context) + ".Consumer";
}
case w:
return Ue(e, e.render, "ForwardRef");
case m:
var a = e.displayName || null;
return a !== null ? a : W(e.type) || "Memo";
case O: {
var s = e, l = s._payload, o = s._init;
return a !== null ? a : z(e.type) || "Memo";
case F: {
var o = e, d = o._payload, _ = o._init;
try {
return W(o(l));
return z(_(d));
} catch {

@@ -140,14 +141,47 @@ return null;

}
var Y = Object.assign, B = 0, be, me, ye, ge, he, Ee, Re;
function _e() {
var te = Object.prototype.hasOwnProperty, B = Object.assign;
function ze(e) {
{
var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
return n;
}
}
_e.__reactDisabledLog = !0;
function qe() {
function Ve(e) {
try {
return be(e), !1;
} catch {
return !0;
}
}
function be(e) {
return "" + e;
}
function ye(e) {
if (Ve(e))
return x("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", ze(e)), be(e);
}
var Be = Symbol.for("react.client.reference");
function Ge(e) {
return !!(typeof e == "string" || typeof e == "function" || e === S || e === T || y || e === A || e === j || e === E || R || e === k || i || f || typeof e == "object" && e !== null && (e.$$typeof === F || e.$$typeof === m || e.$$typeof === P || !p || e.$$typeof === D || e.$$typeof === w || // 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 === Be || e.getModuleId !== void 0));
}
var Je = Array.isArray;
function ne(e) {
return Je(e);
}
var H = 0, Ee, he, ge, Re, Te, _e, Se;
function je() {
}
je.__reactDisabledLog = !0;
function He() {
{
if (B === 0) {
be = console.log, me = console.info, ye = console.warn, ge = console.error, he = console.group, Ee = console.groupCollapsed, Re = console.groupEnd;
if (H === 0) {
Ee = console.log, he = console.info, ge = console.warn, Re = console.error, Te = console.group, _e = console.groupCollapsed, Se = console.groupEnd;
var e = {
configurable: !0,
enumerable: !0,
value: _e,
value: je,
writable: !0

@@ -165,8 +199,8 @@ };

}
B++;
H++;
}
}
function Je() {
function qe() {
{
if (B--, B === 0) {
if (H--, H === 0) {
var e = {

@@ -178,109 +212,138 @@ configurable: !0,

Object.defineProperties(console, {
log: Y({}, e, {
value: be
log: B({}, e, {
value: Ee
}),
info: Y({}, e, {
value: me
info: B({}, e, {
value: he
}),
warn: Y({}, e, {
value: ye
}),
error: Y({}, e, {
warn: B({}, e, {
value: ge
}),
group: Y({}, e, {
value: he
error: B({}, e, {
value: Re
}),
groupCollapsed: Y({}, e, {
value: Ee
group: B({}, e, {
value: Te
}),
groupEnd: Y({}, e, {
value: Re
groupCollapsed: B({}, e, {
value: _e
}),
groupEnd: B({}, e, {
value: Se
})
});
}
B < 0 && u("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
H < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var ee = g.ReactCurrentDispatcher, re;
function G(e, r, t) {
var ae;
function K(e) {
{
if (re === void 0)
if (ae === void 0)
try {
throw Error();
} catch (s) {
var a = s.stack.trim().match(/\n( *(at )?)/);
re = a && a[1] || "";
} catch (n) {
var r = n.stack.trim().match(/\n( *(at )?)/);
ae = r && r[1] || "";
}
return `
` + re + e;
` + ae + e;
}
}
var te = !1, X;
var oe = !1, Z;
{
var Ge = typeof WeakMap == "function" ? WeakMap : Map;
X = new Ge();
var Xe = typeof WeakMap == "function" ? WeakMap : Map;
Z = new Xe();
}
function Te(e, r) {
if (!e || te)
function Ce(e, r) {
if (!e || oe)
return "";
{
var t = X.get(e);
if (t !== void 0)
return t;
var n = Z.get(e);
if (n !== void 0)
return n;
}
var a;
te = !0;
var s = Error.prepareStackTrace;
oe = !0;
var a = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var l;
l = ee.current, ee.current = null, qe();
try {
if (r) {
var o = function() {
throw Error();
};
if (Object.defineProperty(o.prototype, "props", {
set: function() {
throw Error();
var o = null;
o = O.H, O.H = null, He();
var d = {
DetermineComponentFrameRoot: function() {
var L;
try {
if (r) {
var G = function() {
throw Error();
};
if (Object.defineProperty(G.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(G, []);
} catch ($) {
L = $;
}
Reflect.construct(e, [], G);
} else {
try {
G.call();
} catch ($) {
L = $;
}
e.call(G.prototype);
}
} else {
try {
throw Error();
} catch ($) {
L = $;
}
var J = e();
J && typeof J.catch == "function" && J.catch(function() {
});
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(o, []);
} catch (j) {
a = j;
}
Reflect.construct(e, [], o);
} else {
try {
o.call();
} catch (j) {
a = j;
}
e.call(o.prototype);
} catch ($) {
if ($ && L && typeof $.stack == "string")
return [$.stack, L.stack];
}
} else {
try {
throw Error();
} catch (j) {
a = j;
}
e();
return [null, null];
}
} catch (j) {
if (j && a && typeof j.stack == "string") {
for (var i = j.stack.split(`
`), w = a.stack.split(`
`), y = i.length - 1, h = w.length - 1; y >= 1 && h >= 0 && i[y] !== w[h]; )
h--;
for (; y >= 1 && h >= 0; y--, h--)
if (i[y] !== w[h]) {
if (y !== 1 || h !== 1)
};
d.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
var _ = Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot, "name");
_ && _.configurable && Object.defineProperty(
d.DetermineComponentFrameRoot,
// Configurable properties can be updated even if its writable descriptor
// is set to `false`.
// $FlowFixMe[cannot-write]
"name",
{
value: "DetermineComponentFrameRoot"
}
);
try {
var W = d.DetermineComponentFrameRoot(), M = W[0], U = W[1];
if (M && U) {
for (var g = M.split(`
`), c = U.split(`
`), v = 0, b = 0; v < g.length && !g[v].includes("DetermineComponentFrameRoot"); )
v++;
for (; b < c.length && !c[b].includes("DetermineComponentFrameRoot"); )
b++;
if (v === g.length || b === c.length)
for (v = g.length - 1, b = c.length - 1; v >= 1 && b >= 0 && g[v] !== c[b]; )
b--;
for (; v >= 1 && b >= 0; v--, b--)
if (g[v] !== c[b]) {
if (v !== 1 || b !== 1)
do
if (y--, h--, h < 0 || i[y] !== w[h]) {
var A = `
` + i[y].replace(" at new ", " at ");
return e.displayName && A.includes("<anonymous>") && (A = A.replace("<anonymous>", e.displayName)), typeof e == "function" && X.set(e, A), A;
if (v--, b--, b < 0 || g[v] !== c[b]) {
var I = `
` + g[v].replace(" at new ", " at ");
return e.displayName && I.includes("<anonymous>") && (I = I.replace("<anonymous>", e.displayName)), typeof e == "function" && Z.set(e, I), I;
}
while (y >= 1 && h >= 0);
while (v >= 1 && b >= 0);
break;

@@ -290,37 +353,37 @@ }

} finally {
te = !1, ee.current = l, Je(), Error.prepareStackTrace = s;
oe = !1, O.H = o, qe(), Error.prepareStackTrace = a;
}
var N = e ? e.displayName || e.name : "", M = N ? G(N) : "";
return typeof e == "function" && X.set(e, M), M;
var ee = e ? e.displayName || e.name : "", V = ee ? K(ee) : "";
return typeof e == "function" && Z.set(e, V), V;
}
function Xe(e, r, t) {
return Te(e, !1);
function Ke(e) {
return Ce(e, !1);
}
function He(e) {
function Ze(e) {
var r = e.prototype;
return !!(r && r.isReactComponent);
}
function H(e, r, t) {
function ie(e) {
if (e == null)
return "";
if (typeof e == "function")
return Te(e, He(e));
return Ce(e, Ze(e));
if (typeof e == "string")
return G(e);
return K(e);
switch (e) {
case T:
return G("Suspense");
case v:
return G("SuspenseList");
case j:
return K("Suspense");
case E:
return K("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case c:
return Xe(e.render);
case w:
return Ke(e.render);
case m:
return H(e.type, r, t);
case O: {
var a = e, s = a._payload, l = a._init;
return ie(e.type);
case F: {
var r = e, n = r._payload, a = r._init;
try {
return H(l(s), r, t);
return ie(a(n));
} catch {

@@ -332,62 +395,13 @@ }

}
var z = Object.prototype.hasOwnProperty, Se = {}, Oe = g.ReactDebugCurrentFrame;
function Z(e) {
if (e) {
var r = e._owner, t = H(e.type, e._source, r ? r.type : null);
Oe.setExtraStackFrame(t);
} else
Oe.setExtraStackFrame(null);
}
function Ze(e, r, t, a, s) {
var Qe = Symbol.for("react.client.reference");
function ue() {
{
var l = Function.call.bind(z);
for (var o in e)
if (l(e, o)) {
var i = void 0;
try {
if (typeof e[o] != "function") {
var w = Error((a || "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 w.name = "Invariant Violation", w;
}
i = e[o](r, o, a, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (y) {
i = y;
}
i && !(i instanceof Error) && (Z(s), u("%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).", a || "React class", t, o, typeof i), Z(null)), i instanceof Error && !(i.message in Se) && (Se[i.message] = !0, Z(s), u("Failed %s type: %s", t, i.message), Z(null));
}
var e = O.A;
return e === null ? null : e.getOwner();
}
}
var Qe = Array.isArray;
function ne(e) {
return Qe(e);
}
var we, le;
le = {};
function er(e) {
{
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
return t;
}
}
function rr(e) {
try {
return we(e), !1;
} catch {
return !0;
}
}
function we(e) {
return "" + e;
}
function je(e) {
if (rr(e))
return u("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), we(e);
}
var K = g.ReactCurrentOwner, tr = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Ce, Pe, ae;
ae = {};
function nr(e) {
if (z.call(e, "ref")) {
if (te.call(e, "ref")) {
var r = Object.getOwnPropertyDescriptor(e, "ref").get;

@@ -399,4 +413,4 @@ if (r && r.isReactWarning)

}
function ar(e) {
if (z.call(e, "key")) {
function rr(e) {
if (te.call(e, "key")) {
var r = Object.getOwnPropertyDescriptor(e, "key").get;

@@ -408,15 +422,9 @@ if (r && r.isReactWarning)

}
function ir(e, r) {
if (typeof e.ref == "string" && K.current && r && K.current.stateNode !== r) {
var t = W(K.current.type);
ae[t] || (u('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(K.current.type), e.ref), ae[t] = !0);
}
}
function or(e, r) {
function tr(e, r) {
{
var t = function() {
Ce || (Ce = !0, u("%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));
var n = function() {
we || (we = !0, x("%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,
n.isReactWarning = !0, Object.defineProperty(e, "key", {
get: n,
configurable: !0

@@ -426,26 +434,33 @@ });

}
function ur(e, r) {
function nr() {
{
var t = function() {
Pe || (Pe = !0, u("%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 e = z(this.type);
le[e] || (le[e] = !0, x("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."));
var r = this.props.ref;
return r !== void 0 ? r : null;
}
}
var sr = function(e, r, t, a, s, l, o) {
var i = {
function ar(e, r, n, a, o, d, _, W, M) {
var U;
{
var g = _.ref;
U = g !== void 0 ? g : null;
}
var c;
return c = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: f,
$$typeof: l,
// Built-in properties that belong on the element
type: e,
key: r,
ref: t,
props: o,
props: _,
// Record the component responsible for creating this element.
_owner: l
};
return i._store = {}, Object.defineProperty(i._store, "validated", {
_owner: d
}, U !== null ? Object.defineProperty(c, "ref", {
enumerable: !1,
get: nr
}) : Object.defineProperty(c, "ref", {
enumerable: !1,
value: null
}), c._store = {}, Object.defineProperty(c._store, "validated", {
configurable: !1,

@@ -455,53 +470,83 @@ enumerable: !1,

value: !1
}), Object.defineProperty(i, "_self", {
}), Object.defineProperty(c, "_debugInfo", {
configurable: !1,
enumerable: !1,
writable: !1,
value: a
}), Object.defineProperty(i, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: s
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
};
function fr(e, r, t, a, s) {
writable: !0,
value: null
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
}
function or(e, r, n, a, o) {
{
var l, o = {}, i = null, w = null;
t !== void 0 && (je(t), i = "" + t), ar(r) && (je(r.key), i = "" + r.key), nr(r) && (w = r.ref, ir(r, s));
for (l in r)
z.call(r, l) && !tr.hasOwnProperty(l) && (o[l] = r[l]);
if (e && e.defaultProps) {
var y = e.defaultProps;
for (l in y)
o[l] === void 0 && (o[l] = y[l]);
var d = !1;
return xe(e, r, n, d, a, o);
}
}
function ir(e, r, n, a, o) {
{
var d = !0;
return xe(e, r, n, d, a, o);
}
}
var Oe = {};
function xe(e, r, n, a, o, d) {
{
if (Ge(e)) {
var M = r.children;
if (M !== void 0)
if (a)
if (ne(M)) {
for (var U = 0; U < M.length; U++)
Ae(M[U], e);
Object.freeze && Object.freeze(M);
} else
x("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
Ae(M, e);
} else {
var _ = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (_ += " 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 W;
e === null ? W = "null" : ne(e) ? W = "array" : e !== void 0 && e.$$typeof === l ? (W = "<" + (z(e.type) || "Unknown") + " />", _ = " Did you accidentally export a JSX literal instead of a component?") : W = typeof e, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", W, _);
}
if (i || w) {
var h = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
i && or(o, h), w && ur(o, h);
if (te.call(r, "key")) {
var g = z(e), c = Object.keys(r).filter(function($) {
return $ !== "key";
}), v = c.length > 0 ? "{key: someKey, " + c.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!Oe[g + v]) {
var b = c.length > 0 ? "{" + c.join(": ..., ") + ": ...}" : "{}";
x(`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} />`, v, g, b, g), Oe[g + v] = !0;
}
}
return sr(e, i, w, s, a, K.current, o);
var I = null, ee = null;
n !== void 0 && (ye(n), I = "" + n), rr(r) && (ye(r.key), I = "" + r.key), er(r);
var V;
if (!("key" in r))
V = r;
else {
V = {};
for (var L in r)
L !== "key" && u && (V[L] = r[L]);
}
if (I || !u) {
var G = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
I && tr(V, G);
}
var J = ar(e, I, ee, d, o, ue(), V);
return e === S && fr(J), J;
}
}
var ie = g.ReactCurrentOwner, ke = g.ReactDebugCurrentFrame;
function U(e) {
if (e) {
var r = e._owner, t = H(e.type, e._source, r ? r.type : null);
ke.setExtraStackFrame(t);
} else
ke.setExtraStackFrame(null);
}
var oe;
oe = !1;
function ue(e) {
return typeof e == "object" && e !== null && e.$$typeof === f;
}
function xe() {
function ur() {
{
if (ie.current) {
var e = W(ie.current.type);
if (e)
var e = ue();
if (e) {
var r = z(e.type);
if (r)
return `
Check the render method of \`` + e + "`.";
Check the render method of \`` + r + "`.";
}

@@ -511,19 +556,30 @@ return "";

}
function cr(e) {
return "";
}
var Ae = {};
function lr(e) {
function Ae(e, r) {
{
var r = xe();
if (!r) {
var t = typeof e == "string" ? e : e.displayName || e.name;
t && (r = `
Check the top-level render call using <` + t + ">.");
}
return r;
if (typeof e != "object" || !e)
return;
if (e.$$typeof !== Qe)
if (ne(e))
for (var n = 0; n < e.length; n++) {
var a = e[n];
fe(a) && Pe(a, r);
}
else if (fe(e))
e._store && (e._store.validated = !0);
else {
var o = N(e);
if (typeof o == "function" && o !== e.entries) {
var d = o.call(e);
if (d !== e)
for (var _; !(_ = d.next()).done; )
fe(_.value) && Pe(_.value, r);
}
}
}
}
function Fe(e, r) {
function fe(e) {
return typeof e == "object" && e !== null && e.$$typeof === l;
}
var ke = {};
function Pe(e, r) {
{

@@ -533,217 +589,142 @@ if (!e._store || e._store.validated || e.key != null)

e._store.validated = !0;
var t = lr(r);
if (Ae[t])
var n = lr(r);
if (ke[n])
return;
Ae[t] = !0;
ke[n] = !0;
var a = "";
e && e._owner && e._owner !== ie.current && (a = " It was passed a child from " + W(e._owner.type) + "."), U(e), u('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, a), U(null);
}
}
function Ie(e, r) {
{
if (typeof e != "object")
return;
if (ne(e))
for (var t = 0; t < e.length; t++) {
var a = e[t];
ue(a) && Fe(a, r);
}
else if (ue(e))
e._store && (e._store.validated = !0);
else if (e) {
var s = k(e);
if (typeof s == "function" && s !== e.entries)
for (var l = s.call(e), o; !(o = l.next()).done; )
ue(o.value) && Fe(o.value, r);
if (e && e._owner != null && e._owner !== ue()) {
var o = null;
typeof e._owner.tag == "number" ? o = z(e._owner.type) : typeof e._owner.name == "string" && (o = e._owner.name), a = " It was passed a child from " + o + ".";
}
Q(e), x('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.', n, a), Q(null);
}
}
function dr(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 === c || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
r.$$typeof === m))
t = r.propTypes;
else
return;
if (t) {
var a = W(r);
Ze(t, e.props, "prop", a, e);
} else if (r.PropTypes !== void 0 && !oe) {
oe = !0;
var s = W(r);
u("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
}
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && u("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
function Q(e) {
if (e) {
var r = ie(e.type);
O.setExtraStackFrame(r);
} else
O.setExtraStackFrame(null);
}
function vr(e) {
function lr(e) {
{
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
var a = r[t];
if (a !== "children" && a !== "key") {
U(e), u("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), U(null);
break;
}
var r = ur();
if (!r) {
var n = z(e);
n && (r = `
Check the top-level render call using <` + n + ">.");
}
e.ref !== null && (U(e), u("Invalid attribute `ref` supplied to `React.Fragment`."), U(null));
return r;
}
}
var De = {};
function We(e, r, t, a, s, l) {
{
var o = ze(e);
if (!o) {
var i = "";
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " 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 w = cr();
w ? i += w : i += xe();
var y;
e === null ? y = "null" : ne(e) ? y = "array" : e !== void 0 && e.$$typeof === f ? (y = "<" + (W(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, u("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", y, i);
function fr(e) {
for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
var a = r[n];
if (a !== "children" && a !== "key") {
Q(e), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), Q(null);
break;
}
var h = fr(e, r, t, s, l);
if (h == null)
return h;
if (o) {
var A = r.children;
if (A !== void 0)
if (a)
if (ne(A)) {
for (var N = 0; N < A.length; N++)
Ie(A[N], e);
Object.freeze && Object.freeze(A);
} else
u("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
Ie(A, e);
}
if (z.call(r, "key")) {
var M = W(e), j = Object.keys(r).filter(function(hr) {
return hr !== "key";
}), se = j.length > 0 ? "{key: someKey, " + j.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!De[M + se]) {
var gr = j.length > 0 ? "{" + j.join(": ..., ") + ": ...}" : "{}";
u(`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} />`, se, M, gr, M), De[M + se] = !0;
}
}
return e === E ? vr(h) : dr(h), h;
}
}
function pr(e, r, t) {
return We(e, r, t, !0);
}
function br(e, r, t) {
return We(e, r, t, !1);
}
var mr = br, yr = pr;
J.Fragment = E, J.jsx = mr, J.jsxs = yr;
}()), J;
var sr = or, cr = ir;
X.Fragment = S, X.jsx = sr, X.jsxs = cr;
}()), X;
}
process.env.NODE_ENV === "production" ? le.exports = Tr() : le.exports = Sr();
var de = le.exports, Or = "Expected a function", Ye = NaN, wr = "[object Symbol]", jr = /^\s+|\s+$/g, Cr = /^[-+]0x[0-9a-f]+$/i, Pr = /^0b[01]+$/i, kr = /^0o[0-7]+$/i, xr = parseInt, Ar = typeof Q == "object" && Q && Q.Object === Object && Q, Fr = typeof self == "object" && self && self.Object === Object && self, Ir = Ar || Fr || Function("return this")(), Dr = Object.prototype, Wr = Dr.toString, $r = Math.max, Lr = Math.min, fe = function() {
return Ir.Date.now();
process.env.NODE_ENV === "production" ? de.exports = br() : de.exports = yr();
var ve = de.exports, Er = "Expected a function", $e = NaN, hr = "[object Symbol]", gr = /^\s+|\s+$/g, Rr = /^[-+]0x[0-9a-f]+$/i, Tr = /^0b[01]+$/i, _r = /^0o[0-7]+$/i, Sr = parseInt, jr = typeof re == "object" && re && re.Object === Object && re, Cr = typeof self == "object" && self && self.Object === Object && self, wr = jr || Cr || Function("return this")(), Or = Object.prototype, xr = Or.toString, Ar = Math.max, kr = Math.min, se = function() {
return wr.Date.now();
};
function Yr(n, f, b) {
var E, R, C, _, d, c, T = 0, v = !1, m = !1, O = !0;
if (typeof n != "function")
throw new TypeError(Or);
f = Me(f) || 0, ve(b) && (v = !!b.leading, m = "maxWait" in b, C = m ? $r(Me(b.maxWait) || 0, f) : C, O = "trailing" in b ? !!b.trailing : O);
function P(p) {
var D = E, L = R;
return E = R = void 0, T = p, _ = n.apply(L, D), _;
function Pr(t, i, f) {
var R, u, p, y, l, C, S = 0, A = !1, T = !1, Y = !0;
if (typeof t != "function")
throw new TypeError(Er);
i = De(i) || 0, pe(f) && (A = !!f.leading, T = "maxWait" in f, p = T ? Ar(De(f.maxWait) || 0, i) : p, Y = "trailing" in f ? !!f.trailing : Y);
function D(s) {
var N = R, O = u;
return R = u = void 0, S = s, y = t.apply(O, N), y;
}
function F(p) {
return T = p, d = setTimeout(g, f), v ? P(p) : _;
function P(s) {
return S = s, l = setTimeout(E, i), A ? D(s) : y;
}
function I(p) {
var D = p - c, L = p - T, V = f - D;
return m ? Lr(V, C - L) : V;
function w(s) {
var N = s - C, O = s - S, x = i - N;
return T ? kr(x, p - O) : x;
}
function k(p) {
var D = p - c, L = p - T;
return c === void 0 || D >= f || D < 0 || m && L >= C;
function j(s) {
var N = s - C, O = s - S;
return C === void 0 || N >= i || N < 0 || T && O >= p;
}
function g() {
var p = fe();
if (k(p))
return u(p);
d = setTimeout(g, I(p));
function E() {
var s = se();
if (j(s))
return m(s);
l = setTimeout(E, w(s));
}
function u(p) {
return d = void 0, O && E ? P(p) : (E = R = void 0, _);
function m(s) {
return l = void 0, Y && R ? D(s) : (R = u = void 0, y);
}
function $() {
d !== void 0 && clearTimeout(d), T = 0, E = c = R = d = void 0;
function F() {
l !== void 0 && clearTimeout(l), S = 0, R = C = u = l = void 0;
}
function x() {
return d === void 0 ? _ : u(fe());
function k() {
return l === void 0 ? y : m(se());
}
function S() {
var p = fe(), D = k(p);
if (E = arguments, R = this, c = p, D) {
if (d === void 0)
return F(c);
if (m)
return d = setTimeout(g, f), P(c);
function h() {
var s = se(), N = j(s);
if (R = arguments, u = this, C = s, N) {
if (l === void 0)
return P(C);
if (T)
return l = setTimeout(E, i), D(C);
}
return d === void 0 && (d = setTimeout(g, f)), _;
return l === void 0 && (l = setTimeout(E, i)), y;
}
return S.cancel = $, S.flush = x, S;
return h.cancel = F, h.flush = k, h;
}
function ve(n) {
var f = typeof n;
return !!n && (f == "object" || f == "function");
function pe(t) {
var i = typeof t;
return !!t && (i == "object" || i == "function");
}
function Mr(n) {
return !!n && typeof n == "object";
function Fr(t) {
return !!t && typeof t == "object";
}
function Ur(n) {
return typeof n == "symbol" || Mr(n) && Wr.call(n) == wr;
function Ir(t) {
return typeof t == "symbol" || Fr(t) && xr.call(t) == hr;
}
function Me(n) {
if (typeof n == "number")
return n;
if (Ur(n))
return Ye;
if (ve(n)) {
var f = typeof n.valueOf == "function" ? n.valueOf() : n;
n = ve(f) ? f + "" : f;
function De(t) {
if (typeof t == "number")
return t;
if (Ir(t))
return $e;
if (pe(t)) {
var i = typeof t.valueOf == "function" ? t.valueOf() : t;
t = pe(i) ? i + "" : i;
}
if (typeof n != "string")
return n === 0 ? n : +n;
n = n.replace(jr, "");
var b = Pr.test(n);
return b || kr.test(n) ? xr(n.slice(2), b ? 2 : 8) : Cr.test(n) ? Ye : +n;
if (typeof t != "string")
return t === 0 ? t : +t;
t = t.replace(gr, "");
var f = Tr.test(t);
return f || _r.test(t) ? Sr(t.slice(2), f ? 2 : 8) : Rr.test(t) ? $e : +t;
}
var Nr = Yr;
const Vr = /* @__PURE__ */ _r(Nr);
function Br(n) {
return (f) => {
n.forEach((b) => {
typeof b == "function" ? b(f) : b != null && (b.current = f);
var $r = Pr;
const Dr = /* @__PURE__ */ mr($r);
function Nr(t) {
return (i) => {
t.forEach((f) => {
typeof f == "function" ? f(i) : f != null && (f.current = i);
});
};
}
const zr = [], Kr = { width: "100%", height: "100%" }, qr = Ne(function({
className: f,
children: b,
debounceTime: E = 300,
ignoreDimensions: R = zr,
parentSizeStyles: C,
enableDebounceLeadingCall: _ = !0,
resizeObserverPolyfill: d,
...c
}, T) {
const v = ce(null), m = ce(0), [O, P] = Ve({
const Wr = [], Mr = { width: "100%", height: "100%" }, Yr = Ne(function({
className: i,
children: f,
debounceTime: R = 300,
ignoreDimensions: u = Wr,
parentSizeStyles: p,
enableDebounceLeadingCall: y = !0,
resizeObserverPolyfill: l,
...C
}, S) {
const A = ce(null), T = ce(0), [Y, D] = We({
width: 0,

@@ -753,129 +734,129 @@ height: 0,

left: 0
}), F = Er(() => {
const I = Array.isArray(R) ? R : [R];
return Vr(
(k) => {
P((g) => Object.keys(g).filter(
(S) => g[S] !== k[S]
}), P = vr(() => {
const w = Array.isArray(u) ? u : [u];
return Dr(
(j) => {
D((E) => Object.keys(E).filter(
(h) => E[h] !== j[h]
).every(
(S) => I.includes(S)
) ? g : k);
(h) => w.includes(h)
) ? E : j);
},
E,
{ leading: _ }
R,
{ leading: y }
);
}, [E, _, R]);
return Be(() => {
const I = d || window.ResizeObserver, k = new I((g) => {
g.forEach((u) => {
const { left: $, top: x, width: S, height: p } = (u == null ? void 0 : u.contentRect) ?? {};
m.current = window.requestAnimationFrame(() => {
F({ width: S, height: p, top: x, left: $ });
}, [R, y, u]);
return Me(() => {
const w = l || window.ResizeObserver, j = new w((E) => {
E.forEach((m) => {
const { left: F, top: k, width: h, height: s } = (m == null ? void 0 : m.contentRect) ?? {};
T.current = window.requestAnimationFrame(() => {
P({ width: h, height: s, top: k, left: F });
});
});
});
return v.current && k.observe(v.current), () => {
window.cancelAnimationFrame(m.current), k.disconnect(), F.cancel();
return A.current && j.observe(A.current), () => {
window.cancelAnimationFrame(T.current), j.disconnect(), P.cancel();
};
}, [F, d]), /* @__PURE__ */ de.jsx(
}, [P, l]), /* @__PURE__ */ ve.jsx(
"div",
{
style: { ...Kr, ...C },
ref: Br([T, v]),
className: f,
...c,
children: b({
...O,
ref: v.current,
resize: F
style: { ...Mr, ...p },
ref: Nr([S, A]),
className: i,
...C,
children: f({
...Y,
ref: A.current,
resize: P
})
}
);
}), Xr = Ne(
}), zr = Ne(
({
scene: n,
style: f,
onMouseDown: b,
onMouseUp: E,
onMouseHover: R,
onKeyDown: C,
onKeyUp: _,
onStart: d,
onLookAt: c,
onFollow: T,
onWheel: v,
onLoad: m,
renderOnDemand: O = !0,
...P
}, F) => {
const I = ce(null), [k, g] = Ve(!0);
return Be(() => {
g(!0);
let u;
const $ = [
scene: t,
style: i,
onMouseDown: f,
onMouseUp: R,
onMouseHover: u,
onKeyDown: p,
onKeyUp: y,
onStart: l,
onLookAt: C,
onFollow: S,
onWheel: A,
onLoad: T,
renderOnDemand: Y = !0,
...D
}, P) => {
const w = ce(null), [j, E] = We(!0);
return Me(() => {
E(!0);
let m;
const F = [
{
name: "mouseDown",
cb: b
cb: f
},
{
name: "mouseUp",
cb: E
cb: R
},
{
name: "mouseHover",
cb: R
cb: u
},
{
name: "keyDown",
cb: C
cb: p
},
{
name: "keyUp",
cb: _
cb: y
},
{
name: "start",
cb: d
cb: l
},
{
name: "lookAt",
cb: c
cb: C
},
{
name: "follow",
cb: T
cb: S
},
{
name: "scroll",
cb: v
cb: A
}
];
if (I.current) {
u = new Rr(I.current, { renderOnDemand: O });
async function x() {
await u.load(n);
for (let S of $)
S.cb && u.addEventListener(S.name, S.cb);
g(!1), m == null || m(u);
if (w.current) {
m = new pr(w.current, { renderOnDemand: Y });
async function k() {
await m.load(t);
for (let h of F)
h.cb && m.addEventListener(h.name, h.cb);
E(!1), T == null || T(m);
}
x();
k();
}
return () => {
for (let x of $)
x.cb && u.removeEventListener(x.name, x.cb);
u.dispose();
for (let k of F)
k.cb && m.removeEventListener(k.name, k.cb);
m.dispose();
};
}, [n]), /* @__PURE__ */ de.jsx(
qr,
}, [t]), /* @__PURE__ */ ve.jsx(
Yr,
{
ref: F,
parentSizeStyles: f,
ref: P,
parentSizeStyles: i,
debounceTime: 50,
...P,
children: () => /* @__PURE__ */ de.jsx(
...D,
children: () => /* @__PURE__ */ ve.jsx(
"canvas",
{
ref: I,
ref: w,
style: {
display: k ? "none" : "block"
display: j ? "none" : "block"
}

@@ -889,3 +870,3 @@ }

export {
Xr as default
zr as default
};
{
"name": "@splinetool/react-spline",
"version": "3.0.2",
"version": "3.0.3",
"packageManager": "yarn@3.3.0",

@@ -41,4 +41,4 @@ "files": [

"np": "^10.0.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "19.0.0-rc-f994737d14-20240522",
"react-dom": "19.0.0-rc-f994737d14-20240522",
"typescript": "^5.4.5",

@@ -45,0 +45,0 @@ "vite": "^5.2.11"

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