react-light-tour
Advanced tools
Comparing version 0.0.5 to 0.1.0
@@ -8,3 +8,3 @@ import * as React from 'react'; | ||
type Steps = Step[]; | ||
declare const Tour: ({ isRun, steps, buttonsClassName, saveKey, nextText, previewText, doneText, }: { | ||
declare const Tour: ({ isRun, steps, buttonsClassName, saveKey, nextText, previewText, doneText, bodyScrollDisable, scrollLogicalPosition, }: { | ||
isRun: boolean; | ||
@@ -20,4 +20,6 @@ steps: Steps; | ||
doneText?: string; | ||
bodyScrollDisable?: boolean; | ||
scrollLogicalPosition?: ScrollLogicalPosition; | ||
}) => React.JSX.Element; | ||
export { type Step, type Steps, Tour as default }; |
@@ -37,3 +37,3 @@ 'use client'; | ||
const Tour = ({ isRun, steps, buttonsClassName, saveKey = 'tour-is-done', nextText = 'next', previewText = 'preview', doneText = 'done' })=>{ | ||
const Tour = ({ isRun, steps, buttonsClassName, saveKey = 'tour-is-done', nextText = 'next', previewText = 'preview', doneText = 'done', bodyScrollDisable = true, scrollLogicalPosition = 'center' })=>{ | ||
const [activeStep, setActiveStep] = React__namespace.useState(0); | ||
@@ -50,5 +50,7 @@ const isTourAddedRef = React__namespace.useRef(false); | ||
behavior: 'smooth', | ||
block: 'center' | ||
block: scrollLogicalPosition | ||
}); | ||
document.body.style.overflow = 'hidden'; | ||
if (!bodyScrollDisable) { | ||
document.body.style.overflow = 'hidden'; | ||
} | ||
element.classList.add('active-tour'); | ||
@@ -68,3 +70,5 @@ const modal = document.createElement('div'); | ||
activeSection == null ? void 0 : activeSection.remove(); | ||
document.body.style.overflow = 'auto'; | ||
if (!bodyScrollDisable) { | ||
document.body.style.overflow = 'auto'; | ||
} | ||
}); | ||
@@ -105,3 +109,5 @@ const text = document.createElement('p'); | ||
localStorage.setItem(saveKey, 'true'); | ||
document.body.style.overflow = 'auto'; | ||
if (!bodyScrollDisable) { | ||
document.body.style.overflow = 'auto'; | ||
} | ||
} | ||
@@ -108,0 +114,0 @@ }); |
{ | ||
"name": "react-light-tour", | ||
"version": "0.0.5", | ||
"version": "0.1.0", | ||
"description": "lightweight onboarding tour for react", | ||
@@ -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
19759
264