Comparing version 0.1.4 to 0.1.5
@@ -1,2 +0,2 @@ | ||
import * as react_jsx_runtime from 'react/jsx-runtime'; | ||
import React$1 from 'react'; | ||
@@ -48,5 +48,5 @@ interface TourProviderProps { | ||
declare const TourProvider: ({ children }: TourProviderProps) => react_jsx_runtime.JSX.Element; | ||
declare const TourProvider: ({ children }: TourProviderProps) => React$1.JSX.Element; | ||
declare const Tour: ({ children, ...tour }: TourProps) => react_jsx_runtime.JSX.Element; | ||
declare const Tour: ({ children, ...tour }: TourProps) => React$1.JSX.Element; | ||
@@ -57,2 +57,2 @@ declare const useTourControls: () => TourControls; | ||
export { Tour, TourProvider, useTourControls, useTourState }; | ||
export { Tour, type TourControls, type TourProps, TourProvider, type TourState, type TourStep, useTourControls, useTourState }; |
@@ -1,1 +0,2 @@ | ||
"use strict";var d=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var N=(r,o)=>{for(var e in o)d(r,e,{get:o[e],enumerable:!0})},R=(r,o,e,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let u of V(o))!_.call(r,u)&&u!==e&&d(r,u,{get:()=>o[u],enumerable:!(s=M(o,u))||s.enumerable});return r};var q=r=>R(d({},"__esModule",{value:!0}),r);var G={};N(G,{Tour:()=>x,TourProvider:()=>f,useTourControls:()=>l,useTourState:()=>m});module.exports=q(G);var t=require("react"),P=require("react/jsx-runtime"),T=(0,t.createContext)(null),z=({children:r})=>{var v;let[o,e]=(0,t.useState)(!1),[s,u]=(0,t.useState)(null),[p,a]=(0,t.useState)(0),i=(0,t.useRef)([]).current,c=(v=s==null?void 0:s.steps.length)!=null?v:0,k=(0,t.useCallback)(n=>{i.push(n)},[]),O=(0,t.useCallback)(n=>{let C=i.find(A=>A.id===n);C&&(u(C),e(!0),a(1))},[i]),g=(0,t.useCallback)(()=>{e(!1),u(null),a(0)},[]),E=(0,t.useCallback)(()=>{a(n=>Math.min(c,n+1))},[c]),I=(0,t.useCallback)(()=>{a(n=>Math.max(1,n-1))},[]),y=(0,t.useCallback)(n=>{a(n)},[]);return(0,P.jsx)(T.Provider,{value:{isTourOpen:o,activeTour:s,activeStep:p,totalSteps:c,tours:i,addTour:k,startTour:O,endTour:g,goToStep:y,nextStep:E,prevStep:I},children:r})},f=z;var S=require("react");var B=()=>{let r=(0,S.useContext)(T);if(!r)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.");let{startTour:o,endTour:e,goToStep:s,nextStep:u,prevStep:p,addTour:a}=r;return{startTour:o,endTour:e,goToStep:s,nextStep:u,prevStep:p,addTour:a}},l=B;var h=require("react");var D=()=>{let r=(0,h.useContext)(T);if(!r)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>");let{tours:o,activeStep:e,activeTour:s,isTourOpen:u,totalSteps:p}=r;return{tours:o,activeStep:e,activeTour:s,isTourOpen:u,totalSteps:p}},m=D;var w=require("react"),b=require("react/jsx-runtime"),F=({children:r,...o})=>{let{addTour:e}=l();return(0,w.useEffect)(()=>{e(o)},[e,o]),(0,b.jsx)("div",{className:"tour__container",children:r})},x=F;0&&(module.exports={Tour,TourProvider,useTourControls,useTourState}); | ||
var B=Object.create;var c=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var z=(o,e)=>{for(var t in e)c(o,t,{get:e[t],enumerable:!0})},h=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of V(e))!q.call(o,s)&&s!==t&&c(o,s,{get:()=>e[s],enumerable:!(r=M(e,s))||r.enumerable});return o};var P=(o,e,t)=>(t=o!=null?B(R(o)):{},h(e||!o||!o.__esModule?c(t,"default",{value:o,enumerable:!0}):t,o)),D=o=>h(c({},"__esModule",{value:!0}),o);var K={};z(K,{Tour:()=>C,TourProvider:()=>m,useTourControls:()=>l,useTourState:()=>x});module.exports=D(K);var y=P(require("react")),u=require("react"),i=(0,u.createContext)(null),F=({children:o})=>{var S;let[e,t]=(0,u.useState)(!1),[r,s]=(0,u.useState)(null),[a,p]=(0,u.useState)(0),d=(0,u.useRef)([]).current,T=(S=r==null?void 0:r.steps.length)!=null?S:0,E=(0,u.useCallback)(n=>{d.push(n)},[]),I=(0,u.useCallback)(n=>{let v=d.find(A=>A.id===n);v&&(s(v),t(!0),p(1))},[d]),O=(0,u.useCallback)(()=>{t(!1),s(null),p(0)},[]),_=(0,u.useCallback)(()=>{p(n=>Math.min(T,n+1))},[T]),N=(0,u.useCallback)(()=>{p(n=>Math.max(1,n-1))},[]),j=(0,u.useCallback)(n=>{p(n)},[]);return y.default.createElement(i.Provider,{value:{isTourOpen:e,activeTour:r,activeStep:a,totalSteps:T,tours:d,addTour:E,startTour:I,endTour:O,goToStep:j,nextStep:_,prevStep:N}},o)},m=F;function f(o,{insertAt:e}={}){if(!o||typeof document=="undefined")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o))}f(`.tour__container{border:1px solid #ccc;border-radius:5px;margin:10px;background-color:#000} | ||
`);var w=P(require("react"));var b=require("react");var G=()=>{let o=(0,b.useContext)(i);if(!o)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.");let{startTour:e,endTour:t,goToStep:r,nextStep:s,prevStep:a,addTour:p}=o;return{startTour:e,endTour:t,goToStep:r,nextStep:s,prevStep:a,addTour:p}},l=G;var g=require("react");var H=()=>{let o=(0,g.useContext)(i);if(!o)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>");let{tours:e,activeStep:t,activeTour:r,isTourOpen:s,totalSteps:a}=o;return{tours:e,activeStep:t,activeTour:r,isTourOpen:s,totalSteps:a}},x=H;var k=require("react"),J=({children:o,...e})=>{let{addTour:t}=l();return(0,k.useEffect)(()=>{t(e)},[t,e]),w.default.createElement("div",{className:"tour__container"},o)},C=J;0&&(module.exports={Tour,TourProvider,useTourControls,useTourState}); |
{ | ||
"name": "next-tour", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Guided tours and walkthroughs for Next.js", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10146
71