@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,93 +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: 'start-app',
|
|
10
|
-
name: 'start-app name'
|
|
11
|
-
}, {
|
|
12
|
-
key: 'wizard',
|
|
13
|
-
name: 'showChild activating',
|
|
14
|
-
showChild: 'activating',
|
|
15
|
-
// 激活中才显示 children progress,其他时候都隐藏
|
|
16
|
-
children: [{
|
|
17
|
-
key: 'wizard-01',
|
|
18
|
-
name: 'wizard-child-a'
|
|
19
|
-
}, {
|
|
20
|
-
key: 'wizard-02',
|
|
21
|
-
name: 'wizard-child-b'
|
|
22
|
-
}]
|
|
23
|
-
}, {
|
|
24
|
-
key: 'select-node',
|
|
25
|
-
name: 'showChild activated',
|
|
26
|
-
showChild: 'activated',
|
|
27
|
-
// 激活中或已激活才会显示 children progress
|
|
28
|
-
children: [{
|
|
29
|
-
key: 'select-node-01',
|
|
30
|
-
name: 'select-node-child-a'
|
|
31
|
-
}, {
|
|
32
|
-
key: 'select-node-02',
|
|
33
|
-
name: 'select-node-child-b'
|
|
34
|
-
}]
|
|
35
|
-
}, {
|
|
36
|
-
key: 'launch-app',
|
|
37
|
-
name: 'showChild always',
|
|
38
|
-
showChild: 'always',
|
|
39
|
-
// 默认值,始终展示 children progress
|
|
40
|
-
children: [{
|
|
41
|
-
key: 'launch-app-01',
|
|
42
|
-
name: 'launch-app-child-a'
|
|
43
|
-
}, {
|
|
44
|
-
key: 'launch-app-02',
|
|
45
|
-
name: 'launch-app-child-b'
|
|
46
|
-
}]
|
|
47
|
-
}, {
|
|
48
|
-
key: 'complete-app',
|
|
49
|
-
name: 'complete-app 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("p", {
|
|
70
|
-
children: "memory mode, not linked to history"
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
export default function Demo() {
|
|
74
|
-
const {
|
|
75
|
-
palette
|
|
76
|
-
} = useTheme();
|
|
77
|
-
return /*#__PURE__*/_jsx(BodyContainer, {
|
|
78
|
-
children: /*#__PURE__*/_jsx(StepProvider, {
|
|
79
|
-
steps: testSteps,
|
|
80
|
-
mode: "memory",
|
|
81
|
-
children: /*#__PURE__*/_jsx(Layout, {
|
|
82
|
-
locale: "zh",
|
|
83
|
-
blockletMeta: staticDemo,
|
|
84
|
-
headerEndAddons: /*#__PURE__*/_jsx(HeaderEndAddons, {}),
|
|
85
|
-
navLogo: getNavLogo(palette.mode),
|
|
86
|
-
children: /*#__PURE__*/_jsx(Content, {
|
|
87
|
-
children: /*#__PURE__*/_jsx(TestContent, {})
|
|
88
|
-
})
|
|
89
|
-
})
|
|
90
|
-
})
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
Demo.propTypes = {};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"author": { "email": "wangshijun2010@gmail.com", "name": "wangshijun", "url": "http://github.com/wangshijun" },
|
|
3
|
-
"capabilities": { "clusterMode": false, "component": true },
|
|
4
|
-
"children": [],
|
|
5
|
-
"community": "",
|
|
6
|
-
"description": "Demo blocklet that shows how to serve a static html5 game with Blocklet Server",
|
|
7
|
-
"did": "z8ia4e5vAeDsQEE2P26bQqz9oWR1Lxg9qUMaV",
|
|
8
|
-
"dist": {
|
|
9
|
-
"integrity": "sha512-uL9GnG9k6HpfrqKKcXfsKJmZWpNgs3xqM1lG+Rt5oI1a07wFoqHtMvNFveFnP/blRmP8GpjUTBKwkWFb5MEedQ==",
|
|
10
|
-
"size": 314212,
|
|
11
|
-
"tarball": "static-demo-blocklet-1.3.0.tgz"
|
|
12
|
-
},
|
|
13
|
-
"documentation": "",
|
|
14
|
-
"environments": [],
|
|
15
|
-
"files": ["app/", "screenshots/", "logo.png", "blocklet.yml", "blocklet.md", "README.md"],
|
|
16
|
-
"gitHash": "c349d259c463de4addef326979f2fa9d2c2c9b69",
|
|
17
|
-
"group": "static",
|
|
18
|
-
"homepage": "",
|
|
19
|
-
"interfaces": [
|
|
20
|
-
{ "name": "publicUrl", "path": "/", "port": "BLOCKLET_PORT", "prefix": "*", "protocol": "tcp", "type": "web" }
|
|
21
|
-
],
|
|
22
|
-
"keywords": ["demo", "game", "blocklet"],
|
|
23
|
-
"license": "MIT",
|
|
24
|
-
"logo": "logo.png",
|
|
25
|
-
"main": "app",
|
|
26
|
-
"name": "static-demo-blocklet",
|
|
27
|
-
"nftFactory": "",
|
|
28
|
-
"path": "/static/static-demo-blocklet",
|
|
29
|
-
"payment": { "price": [], "share": [] },
|
|
30
|
-
"repository": {
|
|
31
|
-
"type": "git",
|
|
32
|
-
"url": "git+https://github.com/blocklet/html-2048-sample.git",
|
|
33
|
-
"parsedUrl": "https://github.com/blocklet/html-2048-sample"
|
|
34
|
-
},
|
|
35
|
-
"requirements": { "abtnode": ">=1.1.0", "cpu": "*", "os": "*" },
|
|
36
|
-
"screenshots": ["0-home.png"],
|
|
37
|
-
"signatures": [
|
|
38
|
-
{
|
|
39
|
-
"type": "ED25519",
|
|
40
|
-
"name": "Blocklet Store",
|
|
41
|
-
"signer": "zNKXtdqz6Jbw5mKpojK2nP5gRNiEGJY3mNFF",
|
|
42
|
-
"pk": "z8VahoQa6oS63Ym3rfsmzZEt9Moonbg4JSUiit5J7DRAV",
|
|
43
|
-
"excludes": ["htmlAst", "lastPublishedAt", "stats", "readme"],
|
|
44
|
-
"appended": ["htmlAst", "lastPublishedAt", "stats", "readme"],
|
|
45
|
-
"created": "2022-05-11T03:53:41.476Z",
|
|
46
|
-
"sig": "z4xFd9LnY1oFf47XwfEerj6cPSRmHCQQjXAWDSKGXTWsvbpfE4WGSRCTPUM73eXFunJ2MRbX9AAd9di5frU14j9ko"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"appended": ["htmlAst", "lastPublishedAt", "stats", "readme"],
|
|
50
|
-
"created": "2022-05-11T03:53:39.276Z",
|
|
51
|
-
"excludes": ["htmlAst", "lastPublishedAt", "stats", "readme"],
|
|
52
|
-
"name": "static-demo-blocklet",
|
|
53
|
-
"pk": "z2eCsEyycLQPvqCRxvGBawGwyTfoZF1UpzocGqvtjdx7J",
|
|
54
|
-
"signer": "z1euigAXVHi9cJfJGo2b9QaeQwxjQynSKoJ",
|
|
55
|
-
"type": "ED25519",
|
|
56
|
-
"sig": "z5SNRXdk9mnauCTYrwAp9D5PKcdbz9HtkERQkBiJzLLHnA1fj7REi8GpAkVYx7SroKuk6E7hB7FyoegKX8izDZFqE"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"created": "2022-05-11T03:53:10.846Z",
|
|
60
|
-
"name": "static-demo-blocklet",
|
|
61
|
-
"pk": "z75CxPgkoiANhn1iCMRHQX2w6fSQPgi2qZiqbhQuy9Xo3",
|
|
62
|
-
"sig": "z36PDVVsRWb4D4KB9qAYcNM8DCVQTcLsJyEWMmxtba3HP67FzgW38CfuHFivq2ADjc8Zw3dZ9vr2Ehmt3GVWQwogx",
|
|
63
|
-
"signer": "z1Rq9qSoqvAq1NcJJTzKB1AnM991Cm4JrzW",
|
|
64
|
-
"type": "ED25519"
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
"specVersion": "1.2.7",
|
|
68
|
-
"timeout": { "start": 10 },
|
|
69
|
-
"title": "Static Demo",
|
|
70
|
-
"version": "1.3.0",
|
|
71
|
-
"readme": {
|
|
72
|
-
"en": "# Static Demo Blocklet\n\nThis is a blocklet demo of the 2048 game used to demonstrate how to install and run a blocklet on your Blocklet Server. It is a pure front-end web application written in Javascript, HTML, and CSS. You may already have some basic understanding of [Blocklet](https://www.arcblock.io/en/blocklets) and [Blocklet Server](https://www.arcblock.io/en/node). Now you can have your own blocklet set up and running in just a few minutes.\n\n## How to install and run html-2048-sample\n\n* Click the Launch button\n* You need to purchase a Blocklet Server first (if you don't already have one)\n* Follow the installation wizard to install blocklet on your Blocklet Server\n* Start the installed blocklet in the Blocklet Server console\n* Access the public address of the blocklet\n\n## How it's made?\n\nYou can reference media files in the blocklet.md:\n\n\n"
|
|
73
|
-
},
|
|
74
|
-
"stats": { "downloads": 23681 },
|
|
75
|
-
"category": {
|
|
76
|
-
"name": "fun",
|
|
77
|
-
"locales": { "zh": "娱乐", "en": "Fun" },
|
|
78
|
-
"_id": "6TYF6yIvrVvaNUkw",
|
|
79
|
-
"createdAt": "2022-01-11T01:48:16.351Z",
|
|
80
|
-
"updatedAt": "2022-01-11T01:48:16.351Z"
|
|
81
|
-
},
|
|
82
|
-
"owner": { "did": "z1euigAXVHi9cJfJGo2b9QaeQwxjQynSKoJ", "name": "arcblock", "role": "guest" },
|
|
83
|
-
"lastPublishedAt": "2022-05-11T03:53:41.548Z",
|
|
84
|
-
"registryUrl": "https://store.blocklet.dev"
|
|
85
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ThemeProvider } from '@arcblock/ux/lib/Theme';
|
|
2
|
-
import Default from './demo/default';
|
|
3
|
-
import LogoUrl from './demo/logo-url';
|
|
4
|
-
import ChildProgress from './demo/child-progress';
|
|
5
|
-
import MemoryMode from './demo/memory-mode';
|
|
6
|
-
import OptionalStep from './demo/optional-step';
|
|
7
|
-
import ChildProgressInMemoryMode from './demo/child-progress-in-memory-mode';
|
|
8
|
-
import ShowChild from './demo/show-child';
|
|
9
|
-
import LongestStepsForLaunch from './demo/longest-steps-for-launch';
|
|
10
|
-
import OldCodeCompatible from './demo/old-code-compatible';
|
|
11
|
-
import ExtraNav from './demo/extra-nav';
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
export default {
|
|
14
|
-
title: 'Blocklet-Launcher/Layout',
|
|
15
|
-
parameters: {
|
|
16
|
-
layout: 'fullscreen',
|
|
17
|
-
readme: {
|
|
18
|
-
sidebar: '<!-- PROPS -->'
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
decorators: [Story => /*#__PURE__*/_jsx(ThemeProvider, {
|
|
22
|
-
prefer: "system",
|
|
23
|
-
children: /*#__PURE__*/_jsx(Story, {})
|
|
24
|
-
})]
|
|
25
|
-
};
|
|
26
|
-
Default.argTypes = {};
|
|
27
|
-
Default.storyName = 'Default';
|
|
28
|
-
export { Default, LogoUrl, ChildProgress, MemoryMode, OptionalStep, ChildProgressInMemoryMode, ShowChild, LongestStepsForLaunch, OldCodeCompatible, ExtraNav };
|