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

next-tour

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-tour - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

dist/components/index.d.ts

5

dist/index.d.ts

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

export declare const math: {
sum: (a: number, b: number) => number;
};
export { TourProvider } from "./components";
export { useTourControls, useTourState } from "./hooks";

687

dist/next-tour.es.js

@@ -1,6 +0,687 @@

const o = {
sum: (t, m) => t + m
import xe, { createContext as cr, useState as q, useCallback as A, useContext as je } from "react";
var re = { exports: {} }, W = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var we;
function fr() {
if (we)
return W;
we = 1;
var E = xe, b = Symbol.for("react.element"), R = Symbol.for("react.fragment"), p = Object.prototype.hasOwnProperty, T = E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
function S(P, s, O) {
var d, m = {}, w = null, k = null;
O !== void 0 && (w = "" + O), s.key !== void 0 && (w = "" + s.key), s.ref !== void 0 && (k = s.ref);
for (d in s)
p.call(s, d) && !h.hasOwnProperty(d) && (m[d] = s[d]);
if (P && P.defaultProps)
for (d in s = P.defaultProps, s)
m[d] === void 0 && (m[d] = s[d]);
return { $$typeof: b, type: P, key: w, ref: k, props: m, _owner: T.current };
}
return W.Fragment = R, W.jsx = S, W.jsxs = S, W;
}
var Y = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Ce;
function dr() {
return Ce || (Ce = 1, process.env.NODE_ENV !== "production" && function() {
var E = xe, b = Symbol.for("react.element"), R = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), T = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), S = Symbol.for("react.provider"), P = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), L = Symbol.iterator, J = "@@iterator";
function y(e) {
if (e === null || typeof e != "object")
return null;
var r = L && e[L] || e[J];
return typeof r == "function" ? r : null;
}
var _ = E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function f(e) {
{
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
t[n - 1] = arguments[n];
ke("error", e, t);
}
}
function ke(e, r, t) {
{
var n = _.ReactDebugCurrentFrame, i = n.getStackAddendum();
i !== "" && (r += "%s", t = t.concat([i]));
var u = t.map(function(o) {
return String(o);
});
u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
}
}
var De = !1, Fe = !1, Ae = !1, Ie = !1, $e = !1, ne;
ne = Symbol.for("react.module.reference");
function We(e) {
return !!(typeof e == "string" || typeof e == "function" || e === p || e === h || $e || e === T || e === O || e === d || Ie || e === k || De || Fe || Ae || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === m || e.$$typeof === S || e.$$typeof === P || e.$$typeof === s || // 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 === ne || e.getModuleId !== void 0));
}
function Ye(e, r, t) {
var n = e.displayName;
if (n)
return n;
var i = r.displayName || r.name || "";
return i !== "" ? t + "(" + i + ")" : t;
}
function ae(e) {
return e.displayName || "Context";
}
function C(e) {
if (e == null)
return null;
if (typeof e.tag == "number" && f("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 p:
return "Fragment";
case R:
return "Portal";
case h:
return "Profiler";
case T:
return "StrictMode";
case O:
return "Suspense";
case d:
return "SuspenseList";
}
if (typeof e == "object")
switch (e.$$typeof) {
case P:
var r = e;
return ae(r) + ".Consumer";
case S:
var t = e;
return ae(t._context) + ".Provider";
case s:
return Ye(e, e.render, "ForwardRef");
case m:
var n = e.displayName || null;
return n !== null ? n : C(e.type) || "Memo";
case w: {
var i = e, u = i._payload, o = i._init;
try {
return C(o(u));
} catch {
return null;
}
}
}
return null;
}
var j = Object.assign, I = 0, oe, ie, ue, se, le, ce, fe;
function de() {
}
de.__reactDisabledLog = !0;
function Le() {
{
if (I === 0) {
oe = console.log, ie = console.info, ue = console.warn, se = console.error, le = console.group, ce = console.groupCollapsed, fe = 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
});
}
I++;
}
}
function Me() {
{
if (I--, I === 0) {
var e = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: j({}, e, {
value: oe
}),
info: j({}, e, {
value: ie
}),
warn: j({}, e, {
value: ue
}),
error: j({}, e, {
value: se
}),
group: j({}, e, {
value: le
}),
groupCollapsed: j({}, e, {
value: ce
}),
groupEnd: j({}, e, {
value: fe
})
});
}
I < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var G = _.ReactCurrentDispatcher, z;
function M(e, r, t) {
{
if (z === void 0)
try {
throw Error();
} catch (i) {
var n = i.stack.trim().match(/\n( *(at )?)/);
z = n && n[1] || "";
}
return `
` + z + e;
}
}
var K = !1, N;
{
var Ne = typeof WeakMap == "function" ? WeakMap : Map;
N = new Ne();
}
function ve(e, r) {
if (!e || K)
return "";
{
var t = N.get(e);
if (t !== void 0)
return t;
}
var n;
K = !0;
var i = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var u;
u = G.current, G.current = null, Le();
try {
if (r) {
var o = function() {
throw Error();
};
if (Object.defineProperty(o.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(o, []);
} catch (x) {
n = x;
}
Reflect.construct(e, [], o);
} else {
try {
o.call();
} catch (x) {
n = x;
}
e.call(o.prototype);
}
} else {
try {
throw Error();
} catch (x) {
n = x;
}
e();
}
} catch (x) {
if (x && n && typeof x.stack == "string") {
for (var a = x.stack.split(`
`), v = n.stack.split(`
`), l = a.length - 1, c = v.length - 1; l >= 1 && c >= 0 && a[l] !== v[c]; )
c--;
for (; l >= 1 && c >= 0; l--, c--)
if (a[l] !== v[c]) {
if (l !== 1 || c !== 1)
do
if (l--, c--, c < 0 || a[l] !== v[c]) {
var g = `
` + a[l].replace(" at new ", " at ");
return e.displayName && g.includes("<anonymous>") && (g = g.replace("<anonymous>", e.displayName)), typeof e == "function" && N.set(e, g), g;
}
while (l >= 1 && c >= 0);
break;
}
}
} finally {
K = !1, G.current = u, Me(), Error.prepareStackTrace = i;
}
var F = e ? e.displayName || e.name : "", Pe = F ? M(F) : "";
return typeof e == "function" && N.set(e, Pe), Pe;
}
function Ve(e, r, t) {
return ve(e, !1);
}
function Ue(e) {
var r = e.prototype;
return !!(r && r.isReactComponent);
}
function V(e, r, t) {
if (e == null)
return "";
if (typeof e == "function")
return ve(e, Ue(e));
if (typeof e == "string")
return M(e);
switch (e) {
case O:
return M("Suspense");
case d:
return M("SuspenseList");
}
if (typeof e == "object")
switch (e.$$typeof) {
case s:
return Ve(e.render);
case m:
return V(e.type, r, t);
case w: {
var n = e, i = n._payload, u = n._init;
try {
return V(u(i), r, t);
} catch {
}
}
}
return "";
}
var U = Object.prototype.hasOwnProperty, pe = {}, he = _.ReactDebugCurrentFrame;
function B(e) {
if (e) {
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
he.setExtraStackFrame(t);
} else
he.setExtraStackFrame(null);
}
function Be(e, r, t, n, i) {
{
var u = Function.call.bind(U);
for (var o in e)
if (u(e, o)) {
var a = void 0;
try {
if (typeof e[o] != "function") {
var v = 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 v.name = "Invariant Violation", v;
}
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (l) {
a = l;
}
a && !(a instanceof Error) && (B(i), f("%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), B(null)), a instanceof Error && !(a.message in pe) && (pe[a.message] = !0, B(i), f("Failed %s type: %s", t, a.message), B(null));
}
}
}
var qe = Array.isArray;
function H(e) {
return qe(e);
}
function Je(e) {
{
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
return t;
}
}
function Ge(e) {
try {
return ge(e), !1;
} catch {
return !0;
}
}
function ge(e) {
return "" + e;
}
function Ee(e) {
if (Ge(e))
return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), ge(e);
}
var $ = _.ReactCurrentOwner, ze = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, be, me, X;
X = {};
function Ke(e) {
if (U.call(e, "ref")) {
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
if (r && r.isReactWarning)
return !1;
}
return e.ref !== void 0;
}
function He(e) {
if (U.call(e, "key")) {
var r = Object.getOwnPropertyDescriptor(e, "key").get;
if (r && r.isReactWarning)
return !1;
}
return e.key !== void 0;
}
function Xe(e, r) {
if (typeof e.ref == "string" && $.current && r && $.current.stateNode !== r) {
var t = C($.current.type);
X[t] || (f('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', C($.current.type), e.ref), X[t] = !0);
}
}
function Ze(e, r) {
{
var t = function() {
be || (be = !0, f("%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 Qe(e, r) {
{
var t = function() {
me || (me = !0, f("%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 er = function(e, r, t, n, i, u, o) {
var a = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: b,
// Built-in properties that belong on the element
type: e,
key: r,
ref: t,
props: o,
// Record the component responsible for creating this element.
_owner: u
};
return a._store = {}, Object.defineProperty(a._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(a, "_self", {
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 rr(e, r, t, n, i) {
{
var u, o = {}, a = null, v = null;
t !== void 0 && (Ee(t), a = "" + t), He(r) && (Ee(r.key), a = "" + r.key), Ke(r) && (v = r.ref, Xe(r, i));
for (u in r)
U.call(r, u) && !ze.hasOwnProperty(u) && (o[u] = r[u]);
if (e && e.defaultProps) {
var l = e.defaultProps;
for (u in l)
o[u] === void 0 && (o[u] = l[u]);
}
if (a || v) {
var c = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
a && Ze(o, c), v && Qe(o, c);
}
return er(e, a, v, i, n, $.current, o);
}
}
var Z = _.ReactCurrentOwner, ye = _.ReactDebugCurrentFrame;
function D(e) {
if (e) {
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
ye.setExtraStackFrame(t);
} else
ye.setExtraStackFrame(null);
}
var Q;
Q = !1;
function ee(e) {
return typeof e == "object" && e !== null && e.$$typeof === b;
}
function _e() {
{
if (Z.current) {
var e = C(Z.current.type);
if (e)
return `
Check the render method of \`` + e + "`.";
}
return "";
}
}
function tr(e) {
{
if (e !== void 0) {
var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
return `
Check your code at ` + r + ":" + t + ".";
}
return "";
}
}
var Re = {};
function nr(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 = nr(r);
if (Re[t])
return;
Re[t] = !0;
var n = "";
e && e._owner && e._owner !== Z.current && (n = " It was passed a child from " + C(e._owner.type) + "."), D(e), f('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), D(null);
}
}
function Se(e, r) {
{
if (typeof e != "object")
return;
if (H(e))
for (var t = 0; t < e.length; t++) {
var n = e[t];
ee(n) && Te(n, r);
}
else if (ee(e))
e._store && (e._store.validated = !0);
else if (e) {
var i = y(e);
if (typeof i == "function" && i !== e.entries)
for (var u = i.call(e), o; !(o = u.next()).done; )
ee(o.value) && Te(o.value, r);
}
}
}
function ar(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 === s || // 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 n = C(r);
Be(t, e.props, "prop", n, e);
} else if (r.PropTypes !== void 0 && !Q) {
Q = !0;
var i = C(r);
f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
}
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function or(e) {
{
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
var n = r[t];
if (n !== "children" && n !== "key") {
D(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
break;
}
}
e.ref !== null && (D(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
}
}
function Oe(e, r, t, n, i, u) {
{
var o = We(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 v = tr(i);
v ? a += v : a += _e();
var l;
e === null ? l = "null" : H(e) ? l = "array" : e !== void 0 && e.$$typeof === b ? (l = "<" + (C(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
}
var c = rr(e, r, t, i, u);
if (c == null)
return c;
if (o) {
var g = r.children;
if (g !== void 0)
if (n)
if (H(g)) {
for (var F = 0; F < g.length; F++)
Se(g[F], e);
Object.freeze && Object.freeze(g);
} else
f("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
Se(g, e);
}
return e === p ? or(c) : ar(c), c;
}
}
function ir(e, r, t) {
return Oe(e, r, t, !0);
}
function ur(e, r, t) {
return Oe(e, r, t, !1);
}
var sr = ur, lr = ir;
Y.Fragment = p, Y.jsx = sr, Y.jsxs = lr;
}()), Y;
}
process.env.NODE_ENV === "production" ? re.exports = fr() : re.exports = dr();
var vr = re.exports;
const te = cr(null), hr = ({ children: E }) => {
const [b, R] = q(!1), [p, T] = q([]), [h, S] = q(null), [P, s] = q(0), O = (h == null ? void 0 : h.steps.length) ?? 0, d = A((y) => {
T((_) => [..._, y]);
}, []), m = A(
(y) => {
const _ = p.find((f) => f.id === y);
_ && (S(_), R(!0), s(1));
},
[p]
), w = A(() => {
R(!1), S(null), s(0);
}, []), k = A(() => {
s((y) => Math.min(O, y + 1));
}, [O]), L = A(() => {
s((y) => Math.max(1, y - 1));
}, []), J = A((y) => {
s(y);
}, []);
return /* @__PURE__ */ vr.jsx(
te.Provider,
{
value: {
isTourOpen: b,
activeTour: h,
activeStep: P,
totalSteps: O,
tours: p,
addTour: d,
startTour: m,
endTour: w,
goToStep: J,
nextStep: k,
prevStep: L
},
children: E
}
);
}, gr = () => {
const E = je(te);
if (!E)
throw new Error(
"Oops! It looks like useTourControls was called outside of a TourProvider context. Please ensure that your component is wrapped in a <TourProvider> to use the tour controls."
);
const { startTour: b, endTour: R, goToStep: p, nextStep: T, prevStep: h, addTour: S } = E;
return { startTour: b, endTour: R, goToStep: p, nextStep: T, prevStep: h, addTour: S };
}, Er = () => {
const E = je(te);
if (!E)
throw new Error(
"Oops! It looks like useTour was called outside of a TourProvider context. Please ensure that your component is wrapped in a <TourProvider>"
);
const { tours: b, activeStep: R, activeTour: p, isTourOpen: T, totalSteps: h } = E;
return { tours: b, activeStep: R, activeTour: p, isTourOpen: T, totalSteps: h };
};
export {
o as math
hr as TourProvider,
gr as useTourControls,
Er as useTourState
};

@@ -1,1 +0,27 @@

(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.NextTour={}))})(this,function(e){"use strict";const t={sum:(n,o)=>n+o};e.math=t,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
(function(P,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],f):(P=typeof globalThis<"u"?globalThis:P||self,f(P.NextTour={},P.React))})(this,function(P,f){"use strict";var z={exports:{}},W={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ne;function xe(){if(ne)return W;ne=1;var y=f,E=Symbol.for("react.element"),T=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,S=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,b={key:!0,ref:!0,__self:!0,__source:!0};function C(w,s,O){var v,m={},x=null,F=null;O!==void 0&&(x=""+O),s.key!==void 0&&(x=""+s.key),s.ref!==void 0&&(F=s.ref);for(v in s)h.call(s,v)&&!b.hasOwnProperty(v)&&(m[v]=s[v]);if(w&&w.defaultProps)for(v in s=w.defaultProps,s)m[v]===void 0&&(m[v]=s[v]);return{$$typeof:E,type:w,key:x,ref:F,props:m,_owner:S.current}}return W.Fragment=T,W.jsx=C,W.jsxs=C,W}var Y={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ae;function je(){return ae||(ae=1,process.env.NODE_ENV!=="production"&&function(){var y=f,E=Symbol.for("react.element"),T=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),w=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),F=Symbol.for("react.offscreen"),L=Symbol.iterator,H="@@iterator";function R(e){if(e===null||typeof e!="object")return null;var r=L&&e[L]||e[H];return typeof r=="function"?r:null}var _=y.__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=_.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var We=!1,Ye=!1,Me=!1,Ne=!1,Le=!1,oe;oe=Symbol.for("react.module.reference");function Ve(e){return!!(typeof e=="string"||typeof e=="function"||e===h||e===b||Le||e===S||e===O||e===v||Ne||e===F||We||Ye||Me||typeof e=="object"&&e!==null&&(e.$$typeof===x||e.$$typeof===m||e.$$typeof===C||e.$$typeof===w||e.$$typeof===s||e.$$typeof===oe||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 ie(e){return e.displayName||"Context"}function j(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 h:return"Fragment";case T:return"Portal";case b:return"Profiler";case S:return"StrictMode";case O:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w:var r=e;return ie(r)+".Consumer";case C:var t=e;return ie(t._context)+".Provider";case s:return Ue(e,e.render,"ForwardRef");case m:var n=e.displayName||null;return n!==null?n:j(e.type)||"Memo";case x:{var i=e,u=i._payload,o=i._init;try{return j(o(u))}catch{return null}}}return null}var D=Object.assign,M=0,ue,se,le,ce,fe,de,ve;function pe(){}pe.__reactDisabledLog=!0;function Be(){{if(M===0){ue=console.log,se=console.info,le=console.warn,ce=console.error,fe=console.group,de=console.groupCollapsed,ve=console.groupEnd;var e={configurable:!0,enumerable:!0,value:pe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}}function Je(){{if(M--,M===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:ue}),info:D({},e,{value:se}),warn:D({},e,{value:le}),error:D({},e,{value:ce}),group:D({},e,{value:fe}),groupCollapsed:D({},e,{value:de}),groupEnd:D({},e,{value:ve})})}M<0&&d("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var X=_.ReactCurrentDispatcher,Z;function V(e,r,t){{if(Z===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);Z=n&&n[1]||""}return`
`+Z+e}}var Q=!1,U;{var Ge=typeof WeakMap=="function"?WeakMap:Map;U=new Ge}function he(e,r){if(!e||Q)return"";{var t=U.get(e);if(t!==void 0)return t}var n;Q=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=X.current,X.current=null,Be();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(k){n=k}Reflect.construct(e,[],o)}else{try{o.call()}catch(k){n=k}e.call(o.prototype)}}else{try{throw Error()}catch(k){n=k}e()}}catch(k){if(k&&n&&typeof k.stack=="string"){for(var a=k.stack.split(`
`),p=n.stack.split(`
`),l=a.length-1,c=p.length-1;l>=1&&c>=0&&a[l]!==p[c];)c--;for(;l>=1&&c>=0;l--,c--)if(a[l]!==p[c]){if(l!==1||c!==1)do if(l--,c--,c<0||a[l]!==p[c]){var g=`
`+a[l].replace(" at new "," at ");return e.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,g),g}while(l>=1&&c>=0);break}}}finally{Q=!1,X.current=u,Je(),Error.prepareStackTrace=i}var I=e?e.displayName||e.name:"",we=I?V(I):"";return typeof e=="function"&&U.set(e,we),we}function ze(e,r,t){return he(e,!1)}function Ke(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function B(e,r,t){if(e==null)return"";if(typeof e=="function")return he(e,Ke(e));if(typeof e=="string")return V(e);switch(e){case O:return V("Suspense");case v:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case s:return ze(e.render);case m:return B(e.type,r,t);case x:{var n=e,i=n._payload,u=n._init;try{return B(u(i),r,t)}catch{}}}return""}var J=Object.prototype.hasOwnProperty,be={},ge=_.ReactDebugCurrentFrame;function G(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);ge.setExtraStackFrame(t)}else ge.setExtraStackFrame(null)}function He(e,r,t,n,i){{var u=Function.call.bind(J);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var p=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 p.name="Invariant Violation",p}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(G(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),G(null)),a instanceof Error&&!(a.message in be)&&(be[a.message]=!0,G(i),d("Failed %s type: %s",t,a.message),G(null))}}}var Xe=Array.isArray;function $(e){return Xe(e)}function Ze(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Qe(e){try{return ye(e),!1}catch{return!0}}function ye(e){return""+e}function Ee(e){if(Qe(e))return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ze(e)),ye(e)}var N=_.ReactCurrentOwner,$e={key:!0,ref:!0,__self:!0,__source:!0},me,Re,q;q={};function qe(e){if(J.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(J.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function rr(e,r){if(typeof e.ref=="string"&&N.current&&r&&N.current.stateNode!==r){var t=j(N.current.type);q[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',j(N.current.type),e.ref),q[t]=!0)}}function tr(e,r){{var t=function(){me||(me=!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 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,u,o){var a={$$typeof:E,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{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 or(e,r,t,n,i){{var u,o={},a=null,p=null;t!==void 0&&(Ee(t),a=""+t),er(r)&&(Ee(r.key),a=""+r.key),qe(r)&&(p=r.ref,rr(r,i));for(u in r)J.call(r,u)&&!$e.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var l=e.defaultProps;for(u in l)o[u]===void 0&&(o[u]=l[u])}if(a||p){var c=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&tr(o,c),p&&nr(o,c)}return ar(e,a,p,i,n,N.current,o)}}var ee=_.ReactCurrentOwner,_e=_.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);_e.setExtraStackFrame(t)}else _e.setExtraStackFrame(null)}var re;re=!1;function te(e){return typeof e=="object"&&e!==null&&e.$$typeof===E}function Te(){{if(ee.current){var e=j(ee.current.type);if(e)return`
Check the render method of \``+e+"`."}return""}}function ir(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
Check your code at `+r+":"+t+"."}return""}}var Se={};function ur(e){{var r=Te();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 Ce(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ur(r);if(Se[t])return;Se[t]=!0;var n="";e&&e._owner&&e._owner!==ee.current&&(n=" It was passed a child from "+j(e._owner.type)+"."),A(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),A(null)}}function Oe(e,r){{if(typeof e!="object")return;if($(e))for(var t=0;t<e.length;t++){var n=e[t];te(n)&&Ce(n,r)}else if(te(e))e._store&&(e._store.validated=!0);else if(e){var i=R(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)te(o.value)&&Ce(o.value,r)}}}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===s||r.$$typeof===m))t=r.propTypes;else return;if(t){var n=j(r);He(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!re){re=!0;var i=j(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 lr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),d("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}function Pe(e,r,t,n,i,u){{var o=Ve(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 p=ir(i);p?a+=p:a+=Te();var l;e===null?l="null":$(e)?l="array":e!==void 0&&e.$$typeof===E?(l="<"+(j(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=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",l,a)}var c=or(e,r,t,i,u);if(c==null)return c;if(o){var g=r.children;if(g!==void 0)if(n)if($(g)){for(var I=0;I<g.length;I++)Oe(g[I],e);Object.freeze&&Object.freeze(g)}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 Oe(g,e)}return e===h?lr(c):sr(c),c}}function cr(e,r,t){return Pe(e,r,t,!0)}function fr(e,r,t){return Pe(e,r,t,!1)}var dr=fr,vr=cr;Y.Fragment=h,Y.jsx=dr,Y.jsxs=vr}()),Y}process.env.NODE_ENV==="production"?z.exports=xe():z.exports=je();var ke=z.exports;const K=f.createContext(null),De=({children:y})=>{const[E,T]=f.useState(!1),[h,S]=f.useState([]),[b,C]=f.useState(null),[w,s]=f.useState(0),O=(b==null?void 0:b.steps.length)??0,v=f.useCallback(R=>{S(_=>[..._,R])},[]),m=f.useCallback(R=>{const _=h.find(d=>d.id===R);_&&(C(_),T(!0),s(1))},[h]),x=f.useCallback(()=>{T(!1),C(null),s(0)},[]),F=f.useCallback(()=>{s(R=>Math.min(O,R+1))},[O]),L=f.useCallback(()=>{s(R=>Math.max(1,R-1))},[]),H=f.useCallback(R=>{s(R)},[]);return ke.jsx(K.Provider,{value:{isTourOpen:E,activeTour:b,activeStep:w,totalSteps:O,tours:h,addTour:v,startTour:m,endTour:x,goToStep:H,nextStep:F,prevStep:L},children:y})},Fe=()=>{const y=f.useContext(K);if(!y)throw new Error("Oops! It looks like useTourControls was called outside of a TourProvider context. Please ensure that your component is wrapped in a <TourProvider> to use the tour controls.");const{startTour:E,endTour:T,goToStep:h,nextStep:S,prevStep:b,addTour:C}=y;return{startTour:E,endTour:T,goToStep:h,nextStep:S,prevStep:b,addTour:C}},Ae=()=>{const y=f.useContext(K);if(!y)throw new Error("Oops! It looks like useTour was called outside of a TourProvider context. Please ensure that your component is wrapped in a <TourProvider>");const{tours:E,activeStep:T,activeTour:h,isTourOpen:S,totalSteps:b}=y;return{tours:E,activeStep:T,activeTour:h,isTourOpen:S,totalSteps:b}};P.TourProvider=De,P.useTourControls=Fe,P.useTourState=Ae,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
{
"name": "next-tour",
"description": "Guided tours and walkthroughs for Next.js",
"version": "0.1.0",
"version": "0.1.1",
"type": "module",
"main": "dist/next-tour.umd.js",
"main": "dist/next-tour.cjs.js",
"module": "dist/next-tour.es.js",
"types": "dist/index.d.ts",

@@ -14,3 +15,3 @@ "files": [

"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"format": "prettier --write .",

@@ -24,3 +25,2 @@ "preview": "vite preview"

"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@types/react": "^18.2.66",

@@ -32,8 +32,5 @@ "@types/react-dom": "^18.2.22",

"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"prettier": "^3.2.5",
"react": "^18.2.0",

@@ -40,0 +37,0 @@ "react-dom": "^18.2.0",

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