@campxdev/react-blueprint 1.0.7 → 1.0.8
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/package.json
CHANGED
|
@@ -8,6 +8,7 @@ export interface TutorialProps {
|
|
|
8
8
|
steps: Step[];
|
|
9
9
|
children?: ReactNode;
|
|
10
10
|
tourName: string;
|
|
11
|
+
showProgress?: boolean;
|
|
11
12
|
iconPosition?: "left" | "right";
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -16,6 +17,7 @@ export const Tutorial = ({
|
|
|
16
17
|
children,
|
|
17
18
|
tourName,
|
|
18
19
|
iconPosition = "right",
|
|
20
|
+
showProgress = true,
|
|
19
21
|
}: TutorialProps) => {
|
|
20
22
|
const [run, setRun] = useState(false);
|
|
21
23
|
const userTours = localStorage.getItem("userTours") || "[]";
|
|
@@ -33,7 +35,7 @@ export const Tutorial = ({
|
|
|
33
35
|
|
|
34
36
|
const handleJoyrideCallback = (data: CallBackProps) => {
|
|
35
37
|
console.log(data);
|
|
36
|
-
const { action, status, lifecycle, type } = data;
|
|
38
|
+
const { action, status, lifecycle, type, size } = data;
|
|
37
39
|
const reqData = {
|
|
38
40
|
tourName: tourName,
|
|
39
41
|
skipped: false,
|
|
@@ -46,11 +48,15 @@ export const Tutorial = ({
|
|
|
46
48
|
lifecycle === "complete" &&
|
|
47
49
|
type === "tour:end"
|
|
48
50
|
) {
|
|
51
|
+
console.log("Tour is skipped");
|
|
49
52
|
reqData.skipped = true;
|
|
53
|
+
} else if (action === ACTIONS.CLOSE) {
|
|
54
|
+
setRun(false);
|
|
50
55
|
} else if (action === ACTIONS.RESET) {
|
|
56
|
+
console.log("Tour is reset");
|
|
51
57
|
reqData.completed = true;
|
|
52
58
|
}
|
|
53
|
-
|
|
59
|
+
console.log(reqData);
|
|
54
60
|
if (reqData.skipped || reqData.completed) {
|
|
55
61
|
setRun(false); // Stop the tour
|
|
56
62
|
completeTour(reqData).catch((err) => {
|
|
@@ -97,10 +103,10 @@ export const Tutorial = ({
|
|
|
97
103
|
continuous
|
|
98
104
|
run={run}
|
|
99
105
|
showSkipButton
|
|
100
|
-
showProgress
|
|
106
|
+
showProgress={showProgress}
|
|
101
107
|
spotlightPadding={5}
|
|
102
108
|
locale={{
|
|
103
|
-
last: "
|
|
109
|
+
last: "Got it",
|
|
104
110
|
next: "Next",
|
|
105
111
|
skip: "Skip",
|
|
106
112
|
back: "Previous",
|
|
@@ -50,7 +50,14 @@ export const AppHeader = ({
|
|
|
50
50
|
id="jiraIssueCollector"
|
|
51
51
|
className="reportAnIssue"
|
|
52
52
|
>
|
|
53
|
-
<Typography
|
|
53
|
+
<Typography
|
|
54
|
+
variant="button"
|
|
55
|
+
sx={{
|
|
56
|
+
fontWeight: "bold",
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
Report an Issue
|
|
60
|
+
</Typography>
|
|
54
61
|
</Button>
|
|
55
62
|
<UserBox
|
|
56
63
|
fullName={userFullName}
|
|
@@ -42,15 +42,17 @@ export const PrimaryTutorial: StoryObj<typeof Tutorial> = {
|
|
|
42
42
|
),
|
|
43
43
|
args: {
|
|
44
44
|
tourName: "Active Batches",
|
|
45
|
+
showProgress: false,
|
|
45
46
|
steps: [
|
|
46
47
|
{
|
|
47
48
|
target: ".tutorial-target",
|
|
48
49
|
content: "This is my first step",
|
|
50
|
+
disableBeacon: true,
|
|
49
51
|
},
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
52
|
+
// {
|
|
53
|
+
// target: ".next-target",
|
|
54
|
+
// content: "This is the next step",
|
|
55
|
+
// },
|
|
54
56
|
],
|
|
55
57
|
},
|
|
56
58
|
};
|