react-shepherd 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +166 -0
- package/dist/Shepherd.es.js +11 -1
- package/dist/Shepherd.es.js.map +1 -1
- package/dist/Shepherd.js +11 -0
- package/dist/Shepherd.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/package.json +5 -5
- package/dist/index.d.ts.map +0 -1
package/dist/Shepherd.js
CHANGED
|
@@ -4444,6 +4444,16 @@ var addSteps = function (steps, tour) {
|
|
|
4444
4444
|
});
|
|
4445
4445
|
return parsedStepsforAction.forEach(function (step) { return tour.addStep(step); });
|
|
4446
4446
|
};
|
|
4447
|
+
// for instances where Context can't be used or doesn't make sense
|
|
4448
|
+
var useShepherdTour = function (_a) {
|
|
4449
|
+
var tourOptions = _a.tourOptions, steps = _a.steps;
|
|
4450
|
+
var tourObject = React.useMemo(function () {
|
|
4451
|
+
var tourInstance = new Shepherd.Tour(tourOptions);
|
|
4452
|
+
addSteps(steps, tourInstance);
|
|
4453
|
+
return tourInstance;
|
|
4454
|
+
}, [tourOptions, steps]);
|
|
4455
|
+
return tourObject;
|
|
4456
|
+
};
|
|
4447
4457
|
var ShepherdTour = function (_a) {
|
|
4448
4458
|
var children = _a.children, tourOptions = _a.tourOptions, steps = _a.steps;
|
|
4449
4459
|
var tourObject = React.useMemo(function () {
|
|
@@ -4457,4 +4467,5 @@ var ShepherdTour = function (_a) {
|
|
|
4457
4467
|
exports.ShepherdTour = ShepherdTour;
|
|
4458
4468
|
exports.ShepherdTourContext = ShepherdTourContext;
|
|
4459
4469
|
exports.TourMethods = ShepherdTourContextConsumer;
|
|
4470
|
+
exports.useShepherdTour = useShepherdTour;
|
|
4460
4471
|
//# sourceMappingURL=Shepherd.js.map
|