@blocklet/launcher-layout 2.13.69 → 3.0.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/lib/compact-layout.js +27 -78
- package/lib/content.js +16 -18
- package/lib/context/step.js +61 -126
- package/lib/header.js +107 -203
- package/lib/index.js +153 -219
- package/lib/info-list.js +54 -41
- package/lib/launch-result-message.js +39 -63
- package/lib/locale.js +9 -8
- package/lib/markdown-body.js +15 -19
- package/lib/nav.js +138 -190
- package/lib/page-header.js +22 -38
- package/lib/small-circle-progress.js +38 -45
- package/lib/theme-provider.js +21 -38
- package/lib/wizard/hotkey-submit.js +19 -35
- package/lib/wizard/server-eula.js +50 -65
- package/lib/wizard/wizard-desc.js +147 -240
- package/package.json +14 -24
- package/lib/LaunchResultMessage/demo/default.js +0 -82
- package/lib/LaunchResultMessage/result-message.stories.js +0 -27
- package/lib/Layout/demo/child-progress-in-memory-mode.js +0 -70
- package/lib/Layout/demo/child-progress.js +0 -54
- package/lib/Layout/demo/constants.js +0 -76
- package/lib/Layout/demo/default.js +0 -54
- package/lib/Layout/demo/extra-nav.js +0 -108
- package/lib/Layout/demo/logo-url.js +0 -31
- package/lib/Layout/demo/longest-steps-for-launch.js +0 -95
- package/lib/Layout/demo/memory-mode.js +0 -49
- package/lib/Layout/demo/old-code-compatible.js +0 -36
- package/lib/Layout/demo/optional-step.js +0 -61
- package/lib/Layout/demo/show-child.js +0 -93
- package/lib/Layout/demo/static-demo-data.json +0 -85
- package/lib/Layout/layout.stories.js +0 -28
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { useTheme } from '@mui/material';
|
|
3
|
-
import Layout from '../../index';
|
|
4
|
-
import { StepProvider, useStepContext } from '../../context/step';
|
|
5
|
-
import staticDemo from './static-demo-data.json';
|
|
6
|
-
import { BodyContainer, Content, HeaderEndAddons, getNavLogo } from './constants';
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const testSteps = [{
|
|
9
|
-
key: 'wizard',
|
|
10
|
-
name: 'Name1 Wizard',
|
|
11
|
-
children: [{
|
|
12
|
-
key: 'wizard-01',
|
|
13
|
-
name: 'wizard-child-a'
|
|
14
|
-
}, {
|
|
15
|
-
key: 'wizard-02',
|
|
16
|
-
name: 'wizard-child-b'
|
|
17
|
-
}, {
|
|
18
|
-
key: 'wizard-03',
|
|
19
|
-
name: 'wizard-child-c'
|
|
20
|
-
}]
|
|
21
|
-
}, {
|
|
22
|
-
key: 'select-node',
|
|
23
|
-
name: 'Name2 select node'
|
|
24
|
-
}, {
|
|
25
|
-
key: 'launch-app',
|
|
26
|
-
name: 'Name3 launch app'
|
|
27
|
-
}];
|
|
28
|
-
function TestContent() {
|
|
29
|
-
const {
|
|
30
|
-
setActiveStepByKey
|
|
31
|
-
} = useStepContext();
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
const reStep = testSteps.map(e => e.children ? e.children.map(e2 => e2.key) : e.key).flat();
|
|
34
|
-
let index = 0;
|
|
35
|
-
const timer = setInterval(() => {
|
|
36
|
-
setActiveStepByKey(reStep[index]);
|
|
37
|
-
index++;
|
|
38
|
-
if (index >= reStep.length) {
|
|
39
|
-
index = 0;
|
|
40
|
-
}
|
|
41
|
-
}, 1000);
|
|
42
|
-
return () => {
|
|
43
|
-
clearInterval(timer);
|
|
44
|
-
};
|
|
45
|
-
}, [setActiveStepByKey]);
|
|
46
|
-
return /*#__PURE__*/_jsx("p", {
|
|
47
|
-
children: "memory mode, not linked to history"
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
export default function Demo() {
|
|
51
|
-
const {
|
|
52
|
-
palette
|
|
53
|
-
} = useTheme();
|
|
54
|
-
return /*#__PURE__*/_jsx(BodyContainer, {
|
|
55
|
-
children: /*#__PURE__*/_jsx(StepProvider, {
|
|
56
|
-
steps: testSteps,
|
|
57
|
-
mode: "memory",
|
|
58
|
-
children: /*#__PURE__*/_jsx(Layout, {
|
|
59
|
-
locale: "zh",
|
|
60
|
-
blockletMeta: staticDemo,
|
|
61
|
-
headerEndAddons: /*#__PURE__*/_jsx(HeaderEndAddons, {}),
|
|
62
|
-
navLogo: getNavLogo(palette.mode),
|
|
63
|
-
children: /*#__PURE__*/_jsx(Content, {
|
|
64
|
-
children: /*#__PURE__*/_jsx(TestContent, {})
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
})
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
Demo.propTypes = {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { useTheme } from '@mui/material';
|
|
2
|
-
import Layout from '../../index';
|
|
3
|
-
import { StepProvider } from '../../context/step';
|
|
4
|
-
import staticDemo from './static-demo-data.json';
|
|
5
|
-
import { BodyContainer, Content, HeaderEndAddons, getNavLogo } from './constants';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const testSteps = [{
|
|
8
|
-
key: 'wizard',
|
|
9
|
-
name: 'Name1 Wizard',
|
|
10
|
-
path: '/*',
|
|
11
|
-
children: [{
|
|
12
|
-
key: 'wizard-01',
|
|
13
|
-
name: 'wizard-child-a',
|
|
14
|
-
path: '/a'
|
|
15
|
-
}, {
|
|
16
|
-
key: 'wizard-02',
|
|
17
|
-
name: 'wizard-child-b',
|
|
18
|
-
path: '/iframe.html'
|
|
19
|
-
}, {
|
|
20
|
-
key: 'wizard-03',
|
|
21
|
-
name: 'wizard-child-c',
|
|
22
|
-
path: '/c'
|
|
23
|
-
}]
|
|
24
|
-
}, {
|
|
25
|
-
key: 'select-node',
|
|
26
|
-
name: 'Name2 select node',
|
|
27
|
-
path: '/launch/select'
|
|
28
|
-
}, {
|
|
29
|
-
key: 'launch-app',
|
|
30
|
-
name: 'Name3 launch app',
|
|
31
|
-
path: ''
|
|
32
|
-
}];
|
|
33
|
-
export default function Demo() {
|
|
34
|
-
const {
|
|
35
|
-
palette
|
|
36
|
-
} = useTheme();
|
|
37
|
-
return /*#__PURE__*/_jsx(BodyContainer, {
|
|
38
|
-
children: /*#__PURE__*/_jsx(StepProvider, {
|
|
39
|
-
steps: testSteps,
|
|
40
|
-
children: /*#__PURE__*/_jsx(Layout, {
|
|
41
|
-
locale: "zh",
|
|
42
|
-
blockletMeta: staticDemo,
|
|
43
|
-
headerEndAddons: /*#__PURE__*/_jsx(HeaderEndAddons, {}),
|
|
44
|
-
navLogo: getNavLogo(palette.mode),
|
|
45
|
-
children: /*#__PURE__*/_jsx(Content, {
|
|
46
|
-
children: /*#__PURE__*/_jsx("p", {
|
|
47
|
-
children: "set children in steps data"
|
|
48
|
-
})
|
|
49
|
-
})
|
|
50
|
-
})
|
|
51
|
-
})
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
Demo.propTypes = {};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import styled from '@emotion/styled';
|
|
2
|
-
import IconButton from '@mui/material/IconButton';
|
|
3
|
-
import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
|
|
4
|
-
import { ThemeModeToggle } from '@arcblock/ux/lib/Config';
|
|
5
|
-
import LauncherLogo from '@arcblock/icons/lib/LauncherLogo';
|
|
6
|
-
import LauncherLogoNotext from '@arcblock/icons/lib/LauncherLogoNotext';
|
|
7
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
export const steps = [{
|
|
9
|
-
key: 'wizard',
|
|
10
|
-
name: 'Name1 Wizard',
|
|
11
|
-
path: '/'
|
|
12
|
-
}, {
|
|
13
|
-
key: 'select-node',
|
|
14
|
-
name: 'Name2 select node',
|
|
15
|
-
path: '/launch/select'
|
|
16
|
-
}, {
|
|
17
|
-
key: 'launch-app',
|
|
18
|
-
name: 'Name3 launch app',
|
|
19
|
-
path: ''
|
|
20
|
-
}];
|
|
21
|
-
export const LogoContainer = styled.div`
|
|
22
|
-
display: block;
|
|
23
|
-
margin-top: 4px;
|
|
24
|
-
`;
|
|
25
|
-
export const BodyContainer = styled.div`
|
|
26
|
-
position: relative;
|
|
27
|
-
width: 100%;
|
|
28
|
-
height: 100%;
|
|
29
|
-
min-height: 700px;
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
> div {
|
|
33
|
-
flex: 1;
|
|
34
|
-
}
|
|
35
|
-
.ll-container {
|
|
36
|
-
flex: 1;
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
39
|
-
export const Content = styled.div`
|
|
40
|
-
box-sizing: border-box;
|
|
41
|
-
display: flex;
|
|
42
|
-
flex-direction: column;
|
|
43
|
-
justify-content: center;
|
|
44
|
-
align-items: center;
|
|
45
|
-
width: 100%;
|
|
46
|
-
height: 100%;
|
|
47
|
-
`;
|
|
48
|
-
export function HeaderEndAddons() {
|
|
49
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
50
|
-
children: [/*#__PURE__*/_jsx(ThemeModeToggle, {}), /*#__PURE__*/_jsx(IconButton, {
|
|
51
|
-
children: /*#__PURE__*/_jsx(HelpOutlineIcon, {
|
|
52
|
-
style: {
|
|
53
|
-
fontSize: 28
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
})]
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
export function getNavLogo(mode) {
|
|
60
|
-
return {
|
|
61
|
-
desktop: /*#__PURE__*/_jsx(LauncherLogo, {
|
|
62
|
-
style: {
|
|
63
|
-
filter: mode === 'dark' ? 'invert(1)' : 'none'
|
|
64
|
-
},
|
|
65
|
-
width: "145",
|
|
66
|
-
height: "48"
|
|
67
|
-
}),
|
|
68
|
-
mobile: /*#__PURE__*/_jsx(LauncherLogoNotext, {
|
|
69
|
-
style: {
|
|
70
|
-
filter: mode === 'dark' ? 'invert(1)' : 'none'
|
|
71
|
-
},
|
|
72
|
-
width: 32,
|
|
73
|
-
height: 32
|
|
74
|
-
})
|
|
75
|
-
};
|
|
76
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { useTheme } from '@mui/material';
|
|
2
|
-
import Layout from '../../index';
|
|
3
|
-
import { StepProvider } from '../../context/step';
|
|
4
|
-
import staticDemo from './static-demo-data.json';
|
|
5
|
-
import { BodyContainer, Content, getNavLogo, HeaderEndAddons } from './constants';
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
export default function Demo() {
|
|
8
|
-
const testSteps = [{
|
|
9
|
-
key: 'wizard',
|
|
10
|
-
name: 'Name1 Wizard',
|
|
11
|
-
path: '/',
|
|
12
|
-
description: 'I am desc 1'
|
|
13
|
-
}, {
|
|
14
|
-
key: 'select-node',
|
|
15
|
-
name: 'Name2 select node',
|
|
16
|
-
path: '/launch/select',
|
|
17
|
-
description: 'I am desc 2'
|
|
18
|
-
}, {
|
|
19
|
-
key: 'launch-app',
|
|
20
|
-
name: 'Name3 launch app',
|
|
21
|
-
path: '',
|
|
22
|
-
description: 'I am desc 3'
|
|
23
|
-
}];
|
|
24
|
-
const {
|
|
25
|
-
palette
|
|
26
|
-
} = useTheme();
|
|
27
|
-
return /*#__PURE__*/_jsx(BodyContainer, {
|
|
28
|
-
children: /*#__PURE__*/_jsx(StepProvider, {
|
|
29
|
-
steps: testSteps,
|
|
30
|
-
children: /*#__PURE__*/_jsx(Layout, {
|
|
31
|
-
locale: "zh",
|
|
32
|
-
blockletMeta: staticDemo,
|
|
33
|
-
headerEndAddons: /*#__PURE__*/_jsx(HeaderEndAddons, {}),
|
|
34
|
-
navLogo: getNavLogo(palette.mode),
|
|
35
|
-
children: /*#__PURE__*/_jsxs(Content, {
|
|
36
|
-
children: [/*#__PURE__*/_jsxs("p", {
|
|
37
|
-
children: [/*#__PURE__*/_jsx("b", {
|
|
38
|
-
children: "blockletMeta"
|
|
39
|
-
}), " : Data for blockletMeta to install the application"]
|
|
40
|
-
}), /*#__PURE__*/_jsxs("p", {
|
|
41
|
-
children: [/*#__PURE__*/_jsx("b", {
|
|
42
|
-
children: "navLogo"
|
|
43
|
-
}), " is the icon in the top left corner that is the application icon using the current layout component, using the logo with text in desktop mode and the logo without text in mobile."]
|
|
44
|
-
}), /*#__PURE__*/_jsxs("p", {
|
|
45
|
-
children: [/*#__PURE__*/_jsx("b", {
|
|
46
|
-
children: "headerEndAddons"
|
|
47
|
-
}), " is the button area in the top right corner"]
|
|
48
|
-
})]
|
|
49
|
-
})
|
|
50
|
-
})
|
|
51
|
-
})
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
Demo.propTypes = {};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { useTheme } from '@mui/material';
|
|
2
|
-
import AppsIcon from '@mui/icons-material/Apps';
|
|
3
|
-
import Layout from '../../index';
|
|
4
|
-
import { StepProvider } from '../../context/step';
|
|
5
|
-
import staticDemo from './static-demo-data.json';
|
|
6
|
-
import { BodyContainer, getNavLogo, HeaderEndAddons } from './constants';
|
|
7
|
-
|
|
8
|
-
// helper to remove icon for display
|
|
9
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
function getSerializable(obj) {
|
|
11
|
-
const {
|
|
12
|
-
icon,
|
|
13
|
-
...rest
|
|
14
|
-
} = obj;
|
|
15
|
-
return rest;
|
|
16
|
-
}
|
|
17
|
-
export default function Demo() {
|
|
18
|
-
const testSteps = [{
|
|
19
|
-
key: 'wizard',
|
|
20
|
-
name: 'Name1 Wizard',
|
|
21
|
-
path: '/',
|
|
22
|
-
description: 'I am desc 1'
|
|
23
|
-
}, {
|
|
24
|
-
key: 'select-node',
|
|
25
|
-
name: 'Name2 select node',
|
|
26
|
-
path: '/launch/select',
|
|
27
|
-
description: 'I am desc 2'
|
|
28
|
-
}, {
|
|
29
|
-
key: 'launch-app',
|
|
30
|
-
name: 'Name3 launch app',
|
|
31
|
-
path: '',
|
|
32
|
-
description: 'I am desc 3'
|
|
33
|
-
}];
|
|
34
|
-
const {
|
|
35
|
-
palette
|
|
36
|
-
} = useTheme();
|
|
37
|
-
|
|
38
|
-
// Example 2: With Tooltip and Description
|
|
39
|
-
const tooltipExtraNav = {
|
|
40
|
-
link: 'https://www.baidu.com',
|
|
41
|
-
text: 'My Apps',
|
|
42
|
-
appText: 'View My Apps',
|
|
43
|
-
icon: /*#__PURE__*/_jsx(AppsIcon, {}),
|
|
44
|
-
tooltipText: 'View my apps',
|
|
45
|
-
description: 'Your apps will be shown here'
|
|
46
|
-
};
|
|
47
|
-
return /*#__PURE__*/_jsx(BodyContainer, {
|
|
48
|
-
children: /*#__PURE__*/_jsx(StepProvider, {
|
|
49
|
-
steps: testSteps,
|
|
50
|
-
children: /*#__PURE__*/_jsxs(Layout, {
|
|
51
|
-
locale: "en",
|
|
52
|
-
blockletMeta: staticDemo,
|
|
53
|
-
headerEndAddons: /*#__PURE__*/_jsx(HeaderEndAddons, {}),
|
|
54
|
-
navLogo: getNavLogo(palette.mode),
|
|
55
|
-
extraNav: tooltipExtraNav,
|
|
56
|
-
children: [/*#__PURE__*/_jsxs("div", {
|
|
57
|
-
children: [/*#__PURE__*/_jsxs("p", {
|
|
58
|
-
children: [/*#__PURE__*/_jsx("b", {
|
|
59
|
-
children: "extraNav"
|
|
60
|
-
}), " is used to add additional navigation items to the navigation bar, supporting the following features:"]
|
|
61
|
-
}), /*#__PURE__*/_jsxs("div", {
|
|
62
|
-
children: [/*#__PURE__*/_jsx("h4", {
|
|
63
|
-
children: "Property Description"
|
|
64
|
-
}), /*#__PURE__*/_jsxs("ul", {
|
|
65
|
-
children: [/*#__PURE__*/_jsxs("li", {
|
|
66
|
-
children: [/*#__PURE__*/_jsx("b", {
|
|
67
|
-
children: "text"
|
|
68
|
-
}), ": Main display text"]
|
|
69
|
-
}), /*#__PURE__*/_jsxs("li", {
|
|
70
|
-
children: [/*#__PURE__*/_jsx("b", {
|
|
71
|
-
children: "appText"
|
|
72
|
-
}), ": Optional alternative text (displayed on mobile)"]
|
|
73
|
-
}), /*#__PURE__*/_jsxs("li", {
|
|
74
|
-
children: [/*#__PURE__*/_jsx("b", {
|
|
75
|
-
children: "link"
|
|
76
|
-
}), ": Link to navigate to when clicked"]
|
|
77
|
-
}), /*#__PURE__*/_jsxs("li", {
|
|
78
|
-
children: [/*#__PURE__*/_jsx("b", {
|
|
79
|
-
children: "icon"
|
|
80
|
-
}), ": Optional icon (supports any React node)"]
|
|
81
|
-
}), /*#__PURE__*/_jsxs("li", {
|
|
82
|
-
children: [/*#__PURE__*/_jsx("b", {
|
|
83
|
-
children: "tooltipText"
|
|
84
|
-
}), ": Optional tooltip text"]
|
|
85
|
-
}), /*#__PURE__*/_jsxs("li", {
|
|
86
|
-
children: [/*#__PURE__*/_jsx("b", {
|
|
87
|
-
children: "description"
|
|
88
|
-
}), ": Optional description text"]
|
|
89
|
-
}), /*#__PURE__*/_jsxs("li", {
|
|
90
|
-
children: [/*#__PURE__*/_jsx("b", {
|
|
91
|
-
children: "buttonProps"
|
|
92
|
-
}), ": Custom button properties (supports all MUI Button props)"]
|
|
93
|
-
})]
|
|
94
|
-
})]
|
|
95
|
-
})]
|
|
96
|
-
}), /*#__PURE__*/_jsx("pre", {
|
|
97
|
-
style: {
|
|
98
|
-
background: '#f5f5f5',
|
|
99
|
-
padding: 16,
|
|
100
|
-
borderRadius: 4
|
|
101
|
-
},
|
|
102
|
-
children: JSON.stringify(getSerializable(tooltipExtraNav), null, 2)
|
|
103
|
-
})]
|
|
104
|
-
})
|
|
105
|
-
})
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
Demo.propTypes = {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useTheme } from '@mui/material';
|
|
2
|
-
import Layout from '../../index';
|
|
3
|
-
import { StepProvider } from '../../context/step';
|
|
4
|
-
import staticDemo from './static-demo-data.json';
|
|
5
|
-
import { BodyContainer, Content, steps, HeaderEndAddons, getNavLogo } from './constants';
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
export default function Demo() {
|
|
8
|
-
const {
|
|
9
|
-
palette
|
|
10
|
-
} = useTheme();
|
|
11
|
-
return /*#__PURE__*/_jsx(BodyContainer, {
|
|
12
|
-
children: /*#__PURE__*/_jsx(StepProvider, {
|
|
13
|
-
steps: steps,
|
|
14
|
-
children: /*#__PURE__*/_jsx(Layout, {
|
|
15
|
-
locale: "zh",
|
|
16
|
-
blockletMeta: staticDemo,
|
|
17
|
-
headerEndAddons: /*#__PURE__*/_jsx(HeaderEndAddons, {}),
|
|
18
|
-
logoUrl: "https://store.blocklet.dev/assets/z8ia4e5vAeDsQEE2P26bQqz9oWR1Lxg9qUMaV/logo.png",
|
|
19
|
-
navLogo: getNavLogo(palette.mode),
|
|
20
|
-
children: /*#__PURE__*/_jsx(Content, {
|
|
21
|
-
children: /*#__PURE__*/_jsxs("p", {
|
|
22
|
-
children: [/*#__PURE__*/_jsx("b", {
|
|
23
|
-
children: "logoUrl"
|
|
24
|
-
}), ": The real logo address of the application; if it is not passed, the did-avatar is automatically displayed according to the application did of blockletMeta"]
|
|
25
|
-
})
|
|
26
|
-
})
|
|
27
|
-
})
|
|
28
|
-
})
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
Demo.propTypes = {};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { useTheme } from '@mui/material';
|
|
3
|
-
import Layout from '../../index';
|
|
4
|
-
import { StepProvider, useStepContext } from '../../context/step';
|
|
5
|
-
import staticDemo from './static-demo-data.json';
|
|
6
|
-
import { BodyContainer, Content, HeaderEndAddons, getNavLogo } from './constants';
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const testSteps = [{
|
|
9
|
-
key: 'introduction',
|
|
10
|
-
name: '简介'
|
|
11
|
-
}, {
|
|
12
|
-
key: 'select server',
|
|
13
|
-
name: '选择节点',
|
|
14
|
-
showChild: 'activating',
|
|
15
|
-
description: '将应用安装到选择的节点',
|
|
16
|
-
children: [{
|
|
17
|
-
key: 'select-node-02',
|
|
18
|
-
name: '创建节点'
|
|
19
|
-
}, {
|
|
20
|
-
key: 'select-node-03',
|
|
21
|
-
name: '启动节点'
|
|
22
|
-
}, {
|
|
23
|
-
key: 'select-node-04',
|
|
24
|
-
name: '创建中'
|
|
25
|
-
}]
|
|
26
|
-
}, {
|
|
27
|
-
key: 'launch-app',
|
|
28
|
-
name: '安装应用到节点'
|
|
29
|
-
}, {
|
|
30
|
-
key: 'setup-app',
|
|
31
|
-
name: '设置应用',
|
|
32
|
-
showChild: 'activating',
|
|
33
|
-
description: '按步骤初始化你的应用',
|
|
34
|
-
children: [{
|
|
35
|
-
key: 'setup-app-01',
|
|
36
|
-
name: '链接'
|
|
37
|
-
}, {
|
|
38
|
-
key: 'setup-app-02',
|
|
39
|
-
name: '域名'
|
|
40
|
-
}, {
|
|
41
|
-
key: 'setup-app-03',
|
|
42
|
-
name: '配置'
|
|
43
|
-
}, {
|
|
44
|
-
key: 'setup-app-04',
|
|
45
|
-
name: '访问控制'
|
|
46
|
-
}]
|
|
47
|
-
}, {
|
|
48
|
-
key: 'complete-app',
|
|
49
|
-
name: '启动'
|
|
50
|
-
}];
|
|
51
|
-
function TestContent() {
|
|
52
|
-
const {
|
|
53
|
-
setActiveStepByKey
|
|
54
|
-
} = useStepContext();
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
const reStep = testSteps.map(e => e.children ? e.children.map(e2 => e2.key) : e.key).flat();
|
|
57
|
-
let index = 0;
|
|
58
|
-
const timer = setInterval(() => {
|
|
59
|
-
setActiveStepByKey(reStep[index]);
|
|
60
|
-
index++;
|
|
61
|
-
if (index >= reStep.length) {
|
|
62
|
-
index = 0;
|
|
63
|
-
}
|
|
64
|
-
}, 1000);
|
|
65
|
-
return () => {
|
|
66
|
-
clearInterval(timer);
|
|
67
|
-
};
|
|
68
|
-
}, [setActiveStepByKey]);
|
|
69
|
-
return /*#__PURE__*/_jsx("div", {
|
|
70
|
-
children: /*#__PURE__*/_jsx("p", {
|
|
71
|
-
children: "\u5728\u9009\u62E9\u8282\u70B9\u65F6\uFF0C\u70B9\u51FB\u4E86\u521B\u5EFA\u8282\u70B9\u6309\u94AE\u624D\u51FA\u73B0 \u521B\u5EFA\u8282\u70B9/\u542F\u52A8\u8282\u70B9/\u521B\u5EFA\u4E2D\u4E09\u4E2A\u5B50\u6D41\u7A0B"
|
|
72
|
-
})
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
export default function Demo() {
|
|
76
|
-
const {
|
|
77
|
-
palette
|
|
78
|
-
} = useTheme();
|
|
79
|
-
return /*#__PURE__*/_jsx(BodyContainer, {
|
|
80
|
-
children: /*#__PURE__*/_jsx(StepProvider, {
|
|
81
|
-
steps: testSteps,
|
|
82
|
-
mode: "memory",
|
|
83
|
-
children: /*#__PURE__*/_jsx(Layout, {
|
|
84
|
-
locale: "zh",
|
|
85
|
-
blockletMeta: staticDemo,
|
|
86
|
-
headerEndAddons: /*#__PURE__*/_jsx(HeaderEndAddons, {}),
|
|
87
|
-
navLogo: getNavLogo(palette.mode),
|
|
88
|
-
children: /*#__PURE__*/_jsx(Content, {
|
|
89
|
-
children: /*#__PURE__*/_jsx(TestContent, {})
|
|
90
|
-
})
|
|
91
|
-
})
|
|
92
|
-
})
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
Demo.propTypes = {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { useTheme } from '@mui/material';
|
|
3
|
-
import Layout from '../../index';
|
|
4
|
-
import { StepProvider, useStepContext } from '../../context/step';
|
|
5
|
-
import staticDemo from './static-demo-data.json';
|
|
6
|
-
import { BodyContainer, Content, HeaderEndAddons, getNavLogo } from './constants';
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const testSteps = [{
|
|
9
|
-
key: 'wizard',
|
|
10
|
-
name: 'Name1 Wizard'
|
|
11
|
-
}, {
|
|
12
|
-
key: 'select-node',
|
|
13
|
-
name: 'Name2 select node'
|
|
14
|
-
}, {
|
|
15
|
-
key: 'launch-app',
|
|
16
|
-
name: 'Name3 launch app'
|
|
17
|
-
}];
|
|
18
|
-
function TestContent() {
|
|
19
|
-
const {
|
|
20
|
-
setActiveStepByKey
|
|
21
|
-
} = useStepContext();
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
setActiveStepByKey('select-node');
|
|
24
|
-
}, [setActiveStepByKey]);
|
|
25
|
-
return /*#__PURE__*/_jsx("p", {
|
|
26
|
-
children: "memory mode, not linked to history"
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
export default function Demo() {
|
|
30
|
-
const {
|
|
31
|
-
palette
|
|
32
|
-
} = useTheme();
|
|
33
|
-
return /*#__PURE__*/_jsx(BodyContainer, {
|
|
34
|
-
children: /*#__PURE__*/_jsx(StepProvider, {
|
|
35
|
-
steps: testSteps,
|
|
36
|
-
mode: "memory",
|
|
37
|
-
children: /*#__PURE__*/_jsx(Layout, {
|
|
38
|
-
locale: "zh",
|
|
39
|
-
blockletMeta: staticDemo,
|
|
40
|
-
headerEndAddons: /*#__PURE__*/_jsx(HeaderEndAddons, {}),
|
|
41
|
-
navLogo: getNavLogo(palette.mode),
|
|
42
|
-
children: /*#__PURE__*/_jsx(Content, {
|
|
43
|
-
children: /*#__PURE__*/_jsx(TestContent, {})
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
Demo.propTypes = {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import LauncherLogo from '@arcblock/icons/lib/LauncherLogo';
|
|
2
|
-
import LauncherLogoNotext from '@arcblock/icons/lib/LauncherLogoNotext';
|
|
3
|
-
import { useTheme } from '@mui/material/styles';
|
|
4
|
-
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
5
|
-
import Layout from '../../index';
|
|
6
|
-
import { StepProvider } from '../../context/step';
|
|
7
|
-
import staticDemo from './static-demo-data.json';
|
|
8
|
-
import { BodyContainer, Content, LogoContainer, steps, HeaderEndAddons } from './constants';
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
export default function Demo() {
|
|
11
|
-
const theme = useTheme();
|
|
12
|
-
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
|
|
13
|
-
const logo = isMobile ? /*#__PURE__*/_jsx(LauncherLogoNotext, {
|
|
14
|
-
width: 32,
|
|
15
|
-
height: 32
|
|
16
|
-
}) : /*#__PURE__*/_jsx(LogoContainer, {
|
|
17
|
-
children: /*#__PURE__*/_jsx(LauncherLogo, {
|
|
18
|
-
width: "145",
|
|
19
|
-
height: "48"
|
|
20
|
-
})
|
|
21
|
-
});
|
|
22
|
-
return /*#__PURE__*/_jsx(BodyContainer, {
|
|
23
|
-
children: /*#__PURE__*/_jsx(StepProvider, {
|
|
24
|
-
steps: steps,
|
|
25
|
-
children: /*#__PURE__*/_jsx(Layout, {
|
|
26
|
-
blockletMeta: staticDemo,
|
|
27
|
-
headerEndAddons: /*#__PURE__*/_jsx(HeaderEndAddons, {}),
|
|
28
|
-
navLogo: logo,
|
|
29
|
-
children: /*#__PURE__*/_jsx(Content, {
|
|
30
|
-
children: "I am test content"
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
})
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
Demo.propTypes = {};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { useTheme } from '@mui/material';
|
|
3
|
-
import Layout from '../../index';
|
|
4
|
-
import { StepProvider, useStepContext } from '../../context/step';
|
|
5
|
-
import staticDemo from './static-demo-data.json';
|
|
6
|
-
import { BodyContainer, Content, HeaderEndAddons, getNavLogo } from './constants';
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const testSteps = [{
|
|
9
|
-
key: 'wizard',
|
|
10
|
-
name: 'Name1 Wizard'
|
|
11
|
-
}, {
|
|
12
|
-
key: 'select-node',
|
|
13
|
-
name: 'Name2 select node',
|
|
14
|
-
optional: true
|
|
15
|
-
}, {
|
|
16
|
-
key: 'launch-app',
|
|
17
|
-
name: 'Name3 launch app'
|
|
18
|
-
}];
|
|
19
|
-
function TestContent() {
|
|
20
|
-
const {
|
|
21
|
-
setActiveStepByKey
|
|
22
|
-
} = useStepContext();
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
const reStep = testSteps.map(e => e.key);
|
|
25
|
-
let index = 0;
|
|
26
|
-
const timer = setInterval(() => {
|
|
27
|
-
setActiveStepByKey(reStep[index]);
|
|
28
|
-
index++;
|
|
29
|
-
if (index >= reStep.length) {
|
|
30
|
-
index = 0;
|
|
31
|
-
}
|
|
32
|
-
}, 1000);
|
|
33
|
-
return () => {
|
|
34
|
-
clearInterval(timer);
|
|
35
|
-
};
|
|
36
|
-
}, [setActiveStepByKey]);
|
|
37
|
-
return /*#__PURE__*/_jsx("p", {
|
|
38
|
-
children: "memory mode, not linked to history"
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
export default function Demo() {
|
|
42
|
-
const {
|
|
43
|
-
palette
|
|
44
|
-
} = useTheme();
|
|
45
|
-
return /*#__PURE__*/_jsx(BodyContainer, {
|
|
46
|
-
children: /*#__PURE__*/_jsx(StepProvider, {
|
|
47
|
-
steps: testSteps,
|
|
48
|
-
mode: "memory",
|
|
49
|
-
children: /*#__PURE__*/_jsx(Layout, {
|
|
50
|
-
locale: "zh",
|
|
51
|
-
blockletMeta: staticDemo,
|
|
52
|
-
headerEndAddons: /*#__PURE__*/_jsx(HeaderEndAddons, {}),
|
|
53
|
-
navLogo: getNavLogo(palette.mode),
|
|
54
|
-
children: /*#__PURE__*/_jsx(Content, {
|
|
55
|
-
children: /*#__PURE__*/_jsx(TestContent, {})
|
|
56
|
-
})
|
|
57
|
-
})
|
|
58
|
-
})
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
Demo.propTypes = {};
|