zmp-cli 3.15.6 → 3.15.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/README.md +37 -0
- package/build/index.js +1 -184
- package/config/index.js +1 -44
- package/create/index.js +1 -230
- package/create/utils/generate-app-config.js +1 -34
- package/create/utils/generate-npm-scripts.js +1 -26
- package/create/utils/get-options.js +1 -204
- package/create/utils/npm-scripts.js +1 -62
- package/deploy/index.js +1 -149
- package/deploy/utils/get-options.js +1 -69
- package/deploy/utils/request-upload.js +1 -34
- package/deploy/utils/upload-app.js +1 -82
- package/index.js +1 -319
- package/login/index.js +1 -169
- package/login/utils/get-options.js +1 -58
- package/login/utils/zalo-login.js +1 -32
- package/migrate/icons/update-icon-v3.js +1 -19
- package/migrate/index.js +1 -60
- package/migrate/utils/get-options.js +1 -46
- package/migrate/utils/migrate-react.js +1 -33
- package/package.json +13 -40
- package/start/frame/index.html +264 -254
- package/start/index.js +1 -382
- package/sync/index-to-app-config.js +1 -146
- package/sync/index.js +1 -55
- package/utils/axios.js +1 -15
- package/utils/check-update.js +1 -53
- package/utils/constants.js +1 -20
- package/utils/env.js +1 -39
- package/utils/error.js +1 -16
- package/utils/find-files-by-ext.js +1 -27
- package/utils/find-free-port.js +1 -11
- package/utils/fs-extra.js +1 -90
- package/utils/generate-pages-map.js +1 -17
- package/utils/get-app-info.js +1 -22
- package/utils/get-current-project.js +1 -25
- package/utils/get-ip.js +1 -19
- package/utils/log.js +1 -19
- package/utils/node-blob.js +1 -106
- package/utils/resumable.d.js +1 -0
- package/utils/resumable.js +1 -1204
- package/utils/spinner.js +1 -25
- package/utils/tunnel.js +1 -36
- package/.editorconfig +0 -15
- package/.eslintignore +0 -8
- package/.eslintrc.js +0 -10
- package/.vscode/launch.json +0 -23
- package/LICENSE +0 -21
- package/README.git.md +0 -37
- package/assets/index.js +0 -147
- package/build/dist/index.dev.js +0 -217
- package/config/dist/index.dev.js +0 -48
- package/create/init-zmp-ui.js +0 -216
- package/create/templates/app-parameters.js +0 -33
- package/create/templates/common/css/icons.css +0 -60
- package/create/templates/common/icons/512x512.png +0 -0
- package/create/templates/common/icons/apple-touch-icon.png +0 -0
- package/create/templates/common/icons/favicon.png +0 -0
- package/create/templates/common/postcss.config.js +0 -5
- package/create/templates/common/splash-2732x2732.png +0 -0
- package/create/templates/common/tailwind/postcss.config.js +0 -5
- package/create/templates/common/tailwind/tailwind.config.js +0 -9
- package/create/templates/common/tailwind/tailwind.css +0 -3
- package/create/templates/common/webpack/build.js +0 -41
- package/create/templates/copy-assets.js +0 -158
- package/create/templates/core/babel.config.js +0 -11
- package/create/templates/core/copy-assets.js +0 -83
- package/create/templates/core/generate-home-page.js +0 -143
- package/create/templates/core/generate-root.js +0 -283
- package/create/templates/core/generate-routes.js +0 -155
- package/create/templates/core/generate-scripts.js +0 -94
- package/create/templates/core/pages/404.html +0 -20
- package/create/templates/core/pages/about.html +0 -26
- package/create/templates/core/pages/catalog.html +0 -40
- package/create/templates/core/pages/dynamic-route.html +0 -115
- package/create/templates/core/pages/form.html +0 -258
- package/create/templates/core/pages/left-page-1.html +0 -24
- package/create/templates/core/pages/left-page-2.html +0 -23
- package/create/templates/core/pages/product.html +0 -36
- package/create/templates/core/pages/request-and-load.html +0 -35
- package/create/templates/core/pages/settings.html +0 -252
- package/create/templates/create-folders.js +0 -30
- package/create/templates/dist/generate-styles.dev.js +0 -46
- package/create/templates/generate-config-xml.js +0 -18
- package/create/templates/generate-index.js +0 -49
- package/create/templates/generate-manifest.js +0 -49
- package/create/templates/generate-recoil.js +0 -56
- package/create/templates/generate-routes.js +0 -16
- package/create/templates/generate-scripts.js +0 -16
- package/create/templates/generate-service-worker.js +0 -126
- package/create/templates/generate-store.js +0 -88
- package/create/templates/generate-styles.js +0 -110
- package/create/templates/generate-webpack-config.js +0 -335
- package/create/templates/generate-zmp-custom.js +0 -81
- package/create/templates/react/babel.config.js +0 -12
- package/create/templates/react/components/app-items.jsx +0 -44
- package/create/templates/react/components/navbar-back.jsx +0 -25
- package/create/templates/react/components/user-card.jsx +0 -18
- package/create/templates/react/copy-assets.js +0 -85
- package/create/templates/react/dist/generate-scripts.dev.js +0 -23
- package/create/templates/react/generate-home-page.js +0 -111
- package/create/templates/react/generate-root.js +0 -84
- package/create/templates/react/generate-routes.js +0 -16
- package/create/templates/react/generate-scripts.js +0 -68
- package/create/templates/react/pages/404.js +0 -27
- package/create/templates/react/pages/about.js +0 -52
- package/create/templates/react/pages/catalog.js +0 -112
- package/create/templates/react/pages/dynamic-route.js +0 -80
- package/create/templates/react/pages/form.js +0 -152
- package/create/templates/react/pages/index copy.js +0 -17
- package/create/templates/react/pages/index.js +0 -17
- package/create/templates/react/pages/settings.js +0 -76
- package/create/templates/react/pages/user.js +0 -56
- package/create/templates/react/vite.config.js +0 -11
- package/create/templates/react-typescript/_tsconfig.json +0 -33
- package/create/templates/react-typescript/components/app-items.js +0 -53
- package/create/templates/react-typescript/components/index.js +0 -9
- package/create/templates/react-typescript/components/navbar-back.js +0 -40
- package/create/templates/react-typescript/components/user-card.js +0 -32
- package/create/templates/react-typescript/copy-assets.js +0 -94
- package/create/templates/react-typescript/dist/generate-scripts.dev.js +0 -23
- package/create/templates/react-typescript/generate-home-page.js +0 -113
- package/create/templates/react-typescript/generate-root.js +0 -81
- package/create/templates/react-typescript/generate-routes.js +0 -12
- package/create/templates/react-typescript/generate-scripts.js +0 -67
- package/create/templates/react-typescript/pages/404.js +0 -27
- package/create/templates/react-typescript/pages/about.js +0 -52
- package/create/templates/react-typescript/pages/catalog.js +0 -112
- package/create/templates/react-typescript/pages/dynamic-route.js +0 -80
- package/create/templates/react-typescript/pages/form.js +0 -152
- package/create/templates/react-typescript/pages/index.js +0 -17
- package/create/templates/react-typescript/pages/settings.js +0 -76
- package/create/templates/react-typescript/pages/user.js +0 -56
- package/create/templates/react-typescript/vite.config.js +0 -21
- package/create/templates/svelte/babel.config.js +0 -10
- package/create/templates/svelte/copy-assets.js +0 -47
- package/create/templates/svelte/generate-home-page.js +0 -158
- package/create/templates/svelte/generate-root.js +0 -235
- package/create/templates/svelte/generate-routes.js +0 -91
- package/create/templates/svelte/generate-scripts.js +0 -47
- package/create/templates/svelte/pages/404.svelte +0 -10
- package/create/templates/svelte/pages/about.svelte +0 -16
- package/create/templates/svelte/pages/catalog.svelte +0 -31
- package/create/templates/svelte/pages/dynamic-route.svelte +0 -34
- package/create/templates/svelte/pages/form.svelte +0 -175
- package/create/templates/svelte/pages/left-page-1.svelte +0 -13
- package/create/templates/svelte/pages/left-page-2.svelte +0 -12
- package/create/templates/svelte/pages/product.svelte +0 -21
- package/create/templates/svelte/pages/request-and-load.svelte +0 -21
- package/create/templates/svelte/pages/settings.svelte +0 -175
- package/create/templates/vue/babel.config.js +0 -10
- package/create/templates/vue/components/header.vue +0 -28
- package/create/templates/vue/components/sun-and-moon.vue +0 -34
- package/create/templates/vue/copy-assets.js +0 -67
- package/create/templates/vue/generate-home-page.js +0 -56
- package/create/templates/vue/generate-root.js +0 -50
- package/create/templates/vue/generate-routes.js +0 -7
- package/create/templates/vue/generate-scripts.js +0 -63
- package/create/templates/vue/global-components.d.ts +0 -121
- package/create/templates/vue/icons/moon.svg +0 -3
- package/create/templates/vue/icons/sun.svg +0 -3
- package/create/templates/vue/pages/404.vue +0 -12
- package/create/templates/vue/pages/about.vue +0 -15
- package/create/templates/vue/pages/catalog.vue +0 -39
- package/create/templates/vue/pages/dynamic-route.vue +0 -34
- package/create/templates/vue/pages/form.vue +0 -162
- package/create/templates/vue/pages/left-page-1.vue +0 -14
- package/create/templates/vue/pages/left-page-2.vue +0 -11
- package/create/templates/vue/pages/product.vue +0 -31
- package/create/templates/vue/pages/request-and-load.vue +0 -25
- package/create/templates/vue/pages/settings.vue +0 -18
- package/create/templates/vue/vite.config.js +0 -11
- package/create/templates/zaui/_tsconfig.json +0 -33
- package/create/templates/zaui/babel.config.js +0 -12
- package/create/templates/zaui/components/user-card.jsx +0 -16
- package/create/templates/zaui/copy-assets.js +0 -90
- package/create/templates/zaui/generate-home-page.js +0 -117
- package/create/templates/zaui/generate-root.js +0 -53
- package/create/templates/zaui/generate-routes.js +0 -10
- package/create/templates/zaui/generate-scripts.js +0 -39
- package/create/templates/zaui/generate-user-card.js +0 -55
- package/create/templates/zaui/pages/about.js +0 -129
- package/create/templates/zaui/pages/form.js +0 -123
- package/create/templates/zaui/pages/index.js +0 -9
- package/create/templates/zaui/pages/user.js +0 -109
- package/create/templates/zaui/vite.config.js +0 -11
- package/create/utils/colors.js +0 -94
- package/create/utils/dist/get-options.dev.js +0 -277
- package/create/utils/generate-gitignore.js +0 -43
- package/create/utils/generate-package-json.js +0 -132
- package/create/utils/generate-readme.js +0 -28
- package/create/utils/indent.js +0 -31
- package/create/utils/string.js +0 -13
- package/create/utils/styles-extension.js +0 -9
- package/create/utils/template-if.js +0 -9
- package/deploy/dist/index.dev.js +0 -227
- package/deploy/utils/dist/request-upload.dev.js +0 -62
- package/deploy/utils/dist/upload-app.dev.js +0 -113
- package/dist/bundle.js +0 -1
- package/dist/index.dev.js +0 -352
- package/jsconfig.json +0 -8
- package/login/dist/index.dev.js +0 -223
- package/login/utils/dist/zalo-login.dev.js +0 -41
- package/screenshots/wellcome.jpg +0 -0
- package/show-qr-app/assets/css/style.css +0 -87
- package/show-qr-app/assets/js/qrcode.min.js +0 -1
- package/show-qr-app/index.html +0 -57
- package/show-qr-app/package.json +0 -14
- package/start/dist/index.dev.js +0 -312
- package/start/generate-hr-config.js +0 -59
- package/ui/server.js +0 -194
- package/ui/www/css/app.css +0 -1
- package/ui/www/css/app.css.map +0 -1
- package/ui/www/fonts/ZMPIcons-Regular.eot +0 -0
- package/ui/www/fonts/ZMPIcons-Regular.ttf +0 -0
- package/ui/www/fonts/ZMPIcons-Regular.woff +0 -0
- package/ui/www/fonts/ZMPIcons-Regular.woff2 +0 -0
- package/ui/www/images/logo.png +0 -0
- package/ui/www/index.html +0 -1
- package/ui/www/js/app.js +0 -3
- package/ui/www/js/app.js.LICENSE.txt +0 -20
- package/ui/www/js/app.js.map +0 -1
- package/ui/www/static/icons/apple-touch-icon.png +0 -0
- package/ui/www/static/icons/favicon.png +0 -0
- package/utils/dist/get-app-info.dev.js +0 -54
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
const indent = require('../../utils/indent');
|
|
2
|
-
|
|
3
|
-
module.exports = (options) => {
|
|
4
|
-
const {
|
|
5
|
-
name,
|
|
6
|
-
template,
|
|
7
|
-
} = options;
|
|
8
|
-
|
|
9
|
-
const isBlank = template === 'blank';
|
|
10
|
-
|
|
11
|
-
let description;
|
|
12
|
-
if (template === 'single-view' || template === 'blank') {
|
|
13
|
-
description = `
|
|
14
|
-
<p>Here is your blank ZMP app. Let's see what we have here.</p>
|
|
15
|
-
`;
|
|
16
|
-
}
|
|
17
|
-
if (template === 'split-view') {
|
|
18
|
-
description = `
|
|
19
|
-
<p>This is an example of split view application layout, commonly used on tablets. The main approach of such kind of layout is that you can see different views at the same time.</p>
|
|
20
|
-
|
|
21
|
-
<p>Each view may have different layout, different navbar type (dynamic, fixed or static) or without navbar.</p>
|
|
22
|
-
|
|
23
|
-
<p>The fun thing is that you can easily control one view from another without any line of JavaScript just using "data-view" attribute on links.</p>
|
|
24
|
-
`;
|
|
25
|
-
}
|
|
26
|
-
if (template === 'tabs') {
|
|
27
|
-
description = `
|
|
28
|
-
<p>This is an example of tabs-layout application. The main point of such tabbed layout is that each tab contains independent view with its own routing and navigation.</p>
|
|
29
|
-
|
|
30
|
-
<p>Each tab/view may have different layout, different navbar type (dynamic, fixed or static) or without navbar like this tab.</p>
|
|
31
|
-
`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return indent(0, `
|
|
35
|
-
<div class="page" data-name="home">
|
|
36
|
-
<!-- Top Navbar -->
|
|
37
|
-
${template === 'blank' ? `
|
|
38
|
-
<div class="navbar navbar-large">
|
|
39
|
-
<div class="navbar-bg"></div>
|
|
40
|
-
<div class="navbar-inner sliding">
|
|
41
|
-
<div class="title">${name}</div>
|
|
42
|
-
<div class="title-large">
|
|
43
|
-
<div class="title-large-text">${name}</div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
`.trim() : `
|
|
48
|
-
<div class="navbar navbar-large">
|
|
49
|
-
<div class="navbar-bg"></div>
|
|
50
|
-
<div class="navbar-inner">
|
|
51
|
-
<div class="left">
|
|
52
|
-
<a href="#" class="link icon-only panel-open" data-panel="left">
|
|
53
|
-
<i class="icon zmp-icons if-not-md">menu</i>
|
|
54
|
-
<i class="icon material-icons if-md">menu</i>
|
|
55
|
-
</a>
|
|
56
|
-
</div>
|
|
57
|
-
<div class="title sliding">${name}</div>
|
|
58
|
-
<div class="right">
|
|
59
|
-
<a href="#" class="link icon-only panel-open" data-panel="right">
|
|
60
|
-
<i class="icon zmp-icons if-not-md">menu</i>
|
|
61
|
-
<i class="icon material-icons if-md">menu</i>
|
|
62
|
-
</a>
|
|
63
|
-
</div>
|
|
64
|
-
<div class="title-large">
|
|
65
|
-
<div class="title-large-text">${name}</div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
`.trim()}
|
|
70
|
-
${template !== 'tabs' ? `
|
|
71
|
-
<!-- Toolbar-->
|
|
72
|
-
<div class="toolbar toolbar-bottom">
|
|
73
|
-
<div class="toolbar-inner">
|
|
74
|
-
<a href="#" class="link">Left Link</a>
|
|
75
|
-
<a href="#" class="link">Right Link</a>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
`.trim() : ''}
|
|
79
|
-
<!-- Scrollable page content-->
|
|
80
|
-
<div class="page-content">
|
|
81
|
-
<div class="block block-strong">
|
|
82
|
-
${description.trim()}
|
|
83
|
-
</div>
|
|
84
|
-
${!isBlank ? `
|
|
85
|
-
<div class="block-title">Navigation</div>
|
|
86
|
-
<div class="list">
|
|
87
|
-
<ul>
|
|
88
|
-
<li>
|
|
89
|
-
<a href="/about/" class="item-content item-link">
|
|
90
|
-
<div class="item-inner">
|
|
91
|
-
<div class="item-title">About</div>
|
|
92
|
-
</div>
|
|
93
|
-
</a>
|
|
94
|
-
</li>
|
|
95
|
-
<li>
|
|
96
|
-
<a href="/form/" class="item-content item-link">
|
|
97
|
-
<div class="item-inner">
|
|
98
|
-
<div class="item-title">Form</div>
|
|
99
|
-
</div>
|
|
100
|
-
</a>
|
|
101
|
-
</li>
|
|
102
|
-
</ul>
|
|
103
|
-
</div>
|
|
104
|
-
|
|
105
|
-
<div class="block-title">Modals</div>
|
|
106
|
-
<div class="block block-strong">
|
|
107
|
-
<div class="row">
|
|
108
|
-
<div class="col-50">
|
|
109
|
-
<a href="#" class="button button-raised button-fill popup-open" data-popup="#my-popup">Popup</a>
|
|
110
|
-
</div>
|
|
111
|
-
<div class="col-50">
|
|
112
|
-
<a href="#" class="button button-raised button-fill login-screen-open" data-login-screen="#my-login-screen">Login Screen</a>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
|
|
117
|
-
<div class="block-title">Panels</div>
|
|
118
|
-
<div class="block block-strong">
|
|
119
|
-
<div class="row">
|
|
120
|
-
<div class="col-50">
|
|
121
|
-
<a href="#" class="button button-raised button-fill panel-open" data-panel="left">Left Panel</a>
|
|
122
|
-
</div>
|
|
123
|
-
<div class="col-50">
|
|
124
|
-
<a href="#" class="button button-raised button-fill panel-open" data-panel="right">Right Panel</a>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
|
|
129
|
-
<div class="list links-list">
|
|
130
|
-
<ul>
|
|
131
|
-
<li>
|
|
132
|
-
<a href="/dynamic-route/blog/45/post/125/?foo=bar#about">Dynamic (Component) Route</a>
|
|
133
|
-
</li>
|
|
134
|
-
<li>
|
|
135
|
-
<a href="/load-something-that-doesnt-exist/">Default Route (404)</a>
|
|
136
|
-
</li>
|
|
137
|
-
</ul>
|
|
138
|
-
</div>
|
|
139
|
-
`.trim() : ''}
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
|
-
`).trim();
|
|
143
|
-
};
|
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
const generateHomePage = require('./generate-home-page');
|
|
2
|
-
const indent = require('../../utils/indent');
|
|
3
|
-
const templateIf = require('../../utils/template-if');
|
|
4
|
-
|
|
5
|
-
module.exports = (options) => {
|
|
6
|
-
const {
|
|
7
|
-
template,
|
|
8
|
-
bundler,
|
|
9
|
-
} = options;
|
|
10
|
-
|
|
11
|
-
// Panels
|
|
12
|
-
const leftPanelPlain = `
|
|
13
|
-
<!-- Left panel with cover effect-->
|
|
14
|
-
<div class="panel panel-left panel-cover theme-dark panel-init">
|
|
15
|
-
<div class="view">
|
|
16
|
-
<div class="page">
|
|
17
|
-
<div class="navbar">
|
|
18
|
-
<div class="navbar-bg"></div>
|
|
19
|
-
<div class="navbar-inner">
|
|
20
|
-
<div class="title">Left Panel</div>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
<div class="page-content">
|
|
24
|
-
<div class="block">Left panel content goes here</div>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
`.trim();
|
|
30
|
-
|
|
31
|
-
const leftPanelWithView = `
|
|
32
|
-
<!-- Left panel with cover effect -->
|
|
33
|
-
<div class="panel panel-left panel-cover theme-dark panel-init" data-visible-breakpoint="960">
|
|
34
|
-
<div class="view view-init" data-name="left">
|
|
35
|
-
<div class="page">
|
|
36
|
-
<div class="navbar">
|
|
37
|
-
<div class="navbar-bg"></div>
|
|
38
|
-
<div class="navbar-inner sliding">
|
|
39
|
-
<div class="title">Left Panel</div>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
<div class="page-content">
|
|
43
|
-
<div class="block-title">Left View Navigation</div>
|
|
44
|
-
<div class="list links-list">
|
|
45
|
-
<ul>
|
|
46
|
-
<li><a href="/left-page-1/">Left Page 1</a></li>
|
|
47
|
-
<li><a href="/left-page-2/">Left Page 2</a></li>
|
|
48
|
-
</ul>
|
|
49
|
-
</div>
|
|
50
|
-
<div class="block-title">Control Main View</div>
|
|
51
|
-
<div class="list links-list">
|
|
52
|
-
<ul>
|
|
53
|
-
<li>
|
|
54
|
-
<a href="/about/" data-view=".view-main" class="panel-close">About</a>
|
|
55
|
-
</li>
|
|
56
|
-
<li>
|
|
57
|
-
<a href="/form/" data-view=".view-main" class="panel-close">Form</a>
|
|
58
|
-
</li>
|
|
59
|
-
<li>
|
|
60
|
-
<a href="#" data-view=".view-main" class="back panel-close">Back in history</a>
|
|
61
|
-
</li>
|
|
62
|
-
</ul>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
`;
|
|
69
|
-
const leftPanel = template === 'split-view' ? leftPanelWithView : leftPanelPlain;
|
|
70
|
-
const rightPanel = `
|
|
71
|
-
<!-- Right panel with reveal effect-->
|
|
72
|
-
<div class="panel panel-right panel-reveal theme-dark">
|
|
73
|
-
<div class="view">
|
|
74
|
-
<div class="page">
|
|
75
|
-
<div class="navbar">
|
|
76
|
-
<div class="navbar-bg"></div>
|
|
77
|
-
<div class="navbar-inner">
|
|
78
|
-
<div class="title">Right Panel</div>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
<div class="page-content">
|
|
82
|
-
<div class="block">Right panel content goes here</div>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
`.trim();
|
|
88
|
-
|
|
89
|
-
// Views
|
|
90
|
-
let views = '';
|
|
91
|
-
if (template === 'single-view' || template === 'split-view' || template === 'blank') {
|
|
92
|
-
views = indent(4, `
|
|
93
|
-
<!-- Your main view, should have "view-main" class -->
|
|
94
|
-
${templateIf(bundler === 'webpack', () => `
|
|
95
|
-
<div class="view view-main view-init safe-areas" data-url="/"></div>
|
|
96
|
-
`, () => `
|
|
97
|
-
<div class="view view-main view-init safe-areas">
|
|
98
|
-
${indent(8, generateHomePage(options)).trim()}
|
|
99
|
-
</div>
|
|
100
|
-
`)}
|
|
101
|
-
`);
|
|
102
|
-
}
|
|
103
|
-
if (template === 'tabs') {
|
|
104
|
-
views = indent(4, `
|
|
105
|
-
<!-- Views/Tabs container -->
|
|
106
|
-
<div class="views tabs safe-areas">
|
|
107
|
-
<!-- Tabbar for switching views-tabs -->
|
|
108
|
-
<div class="toolbar toolbar-bottom tabbar-labels">
|
|
109
|
-
<div class="toolbar-inner">
|
|
110
|
-
<a href="#view-home" class="tab-link tab-link-active">
|
|
111
|
-
<i class="icon zmp-icons if-not-md">house_fill</i>
|
|
112
|
-
<i class="icon material-icons if-md">home</i>
|
|
113
|
-
<span class="tabbar-label">Home</span>
|
|
114
|
-
</a>
|
|
115
|
-
<a href="#view-catalog" class="tab-link">
|
|
116
|
-
<i class="icon zmp-icons if-not-md">square_list_fill</i>
|
|
117
|
-
<i class="icon material-icons if-md">view_list</i>
|
|
118
|
-
<span class="tabbar-label">Catalog</span>
|
|
119
|
-
</a>
|
|
120
|
-
<a href="#view-settings" class="tab-link">
|
|
121
|
-
<i class="icon zmp-icons if-not-md">gear</i>
|
|
122
|
-
<i class="icon material-icons if-md">settings</i>
|
|
123
|
-
<span class="tabbar-label">Settings</span>
|
|
124
|
-
</a>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
|
|
128
|
-
<!-- Your main view/tab, should have "view-main" class. It also has "tab-active" class -->
|
|
129
|
-
${templateIf(bundler === 'webpack', () => `
|
|
130
|
-
<div id="view-home" class="view view-main view-init tab tab-active" data-url="/">
|
|
131
|
-
<!-- Home page will be loaded here dynamically from / route -->
|
|
132
|
-
</div>
|
|
133
|
-
`, () => `
|
|
134
|
-
<div id="view-home" class="view view-main view-init tab tab-active">
|
|
135
|
-
${indent(8, generateHomePage(options)).trim()}
|
|
136
|
-
</div>
|
|
137
|
-
`)}
|
|
138
|
-
|
|
139
|
-
<!-- Catalog View -->
|
|
140
|
-
<div id="view-catalog" class="view view-init tab" data-name="catalog" data-url="/catalog/">
|
|
141
|
-
<!-- Catalog page will be loaded here dynamically from /catalog/ route -->
|
|
142
|
-
</div>
|
|
143
|
-
|
|
144
|
-
<!-- Settings View -->
|
|
145
|
-
<div id="view-settings" class="view view-init tab" data-name="settings" data-url="/settings/">
|
|
146
|
-
<!-- Settings page will be loaded here dynamically from /settings/ route -->
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
`);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const htmlTemplate = template === 'blank' ? `
|
|
153
|
-
${views}
|
|
154
|
-
` : `
|
|
155
|
-
${leftPanel}
|
|
156
|
-
${rightPanel}
|
|
157
|
-
${views}
|
|
158
|
-
|
|
159
|
-
<!-- Popup -->
|
|
160
|
-
<div class="popup" id="my-popup">
|
|
161
|
-
<div class="view">
|
|
162
|
-
<div class="page">
|
|
163
|
-
<div class="navbar">
|
|
164
|
-
<div class="navbar-bg"></div>
|
|
165
|
-
<div class="navbar-inner">
|
|
166
|
-
<div class="title">Popup</div>
|
|
167
|
-
<div class="right">
|
|
168
|
-
<a href="#" class="link popup-close">Close</a>
|
|
169
|
-
</div>
|
|
170
|
-
</div>
|
|
171
|
-
</div>
|
|
172
|
-
<div class="page-content">
|
|
173
|
-
<div class="block">
|
|
174
|
-
<p>Popup content goes here.</p>
|
|
175
|
-
</div>
|
|
176
|
-
</div>
|
|
177
|
-
</div>
|
|
178
|
-
</div>
|
|
179
|
-
</div>
|
|
180
|
-
|
|
181
|
-
<!-- Login Screen -->
|
|
182
|
-
<div class="login-screen" id="my-login-screen">
|
|
183
|
-
<div class="view">
|
|
184
|
-
<div class="page">
|
|
185
|
-
<div class="page-content login-screen-content">
|
|
186
|
-
<div class="login-screen-title">Login</div>
|
|
187
|
-
<div class="list">
|
|
188
|
-
<ul>
|
|
189
|
-
<li class="item-content item-input">
|
|
190
|
-
<div class="item-inner">
|
|
191
|
-
<div class="item-title item-label">Username</div>
|
|
192
|
-
<div class="item-input-wrap">
|
|
193
|
-
${templateIf(bundler, () => `
|
|
194
|
-
<input type="text" name="username" placeholder="Your username" value="\${username}" @input="\${updateUsername}"/>
|
|
195
|
-
`)}
|
|
196
|
-
${templateIf(!bundler, () => `
|
|
197
|
-
<input type="text" name="username" placeholder="Your username"/>
|
|
198
|
-
`)}
|
|
199
|
-
</div>
|
|
200
|
-
</div>
|
|
201
|
-
</li>
|
|
202
|
-
<li class="item-content item-input">
|
|
203
|
-
<div class="item-inner">
|
|
204
|
-
<div class="item-title item-label">Password</div>
|
|
205
|
-
<div class="item-input-wrap">
|
|
206
|
-
${templateIf(bundler, () => `
|
|
207
|
-
<input type="password" name="password" placeholder="Your password" value="\${password}" @input="\${updatePassword}"/>
|
|
208
|
-
`)}
|
|
209
|
-
${templateIf(!bundler, () => `
|
|
210
|
-
<input type="password" name="password" placeholder="Your password"/>
|
|
211
|
-
`)}
|
|
212
|
-
</div>
|
|
213
|
-
</div>
|
|
214
|
-
</li>
|
|
215
|
-
</ul>
|
|
216
|
-
</div>
|
|
217
|
-
<div class="list">
|
|
218
|
-
<ul>
|
|
219
|
-
<li>
|
|
220
|
-
${templateIf(bundler, () => `
|
|
221
|
-
<a href="#" class="item-link list-button login-button" @click="\${alertLoginData}">Sign In</a>
|
|
222
|
-
`)}
|
|
223
|
-
${templateIf(!bundler, () => `
|
|
224
|
-
<a href="#" class="item-link list-button login-button">Sign In</a>
|
|
225
|
-
`)}
|
|
226
|
-
</li>
|
|
227
|
-
</ul>
|
|
228
|
-
<div class="block-footer">Some text about login information.<br/>Click "Sign In" to close Login Screen</div>
|
|
229
|
-
</div>
|
|
230
|
-
</div>
|
|
231
|
-
</div>
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
`;
|
|
235
|
-
|
|
236
|
-
if (bundler === 'webpack') {
|
|
237
|
-
if (template === 'blank') {
|
|
238
|
-
return indent(0, `
|
|
239
|
-
<template>
|
|
240
|
-
<div id="app">
|
|
241
|
-
${indent(10, views)}
|
|
242
|
-
</div>
|
|
243
|
-
</template>
|
|
244
|
-
<script>
|
|
245
|
-
export default () => {
|
|
246
|
-
return $render;
|
|
247
|
-
}
|
|
248
|
-
</script>
|
|
249
|
-
`);
|
|
250
|
-
}
|
|
251
|
-
return indent(0, `
|
|
252
|
-
<template>
|
|
253
|
-
<div id="app">
|
|
254
|
-
${indent(10, htmlTemplate)}
|
|
255
|
-
</div>
|
|
256
|
-
</template>
|
|
257
|
-
<script>
|
|
258
|
-
export default (props, { $zmp, $update }) => {
|
|
259
|
-
// Login screen demo data
|
|
260
|
-
let username = '';
|
|
261
|
-
let password = '';
|
|
262
|
-
|
|
263
|
-
const updateUsername = (e) => {
|
|
264
|
-
username = e.target.value;
|
|
265
|
-
$update();
|
|
266
|
-
}
|
|
267
|
-
const updatePassword = (e) => {
|
|
268
|
-
password = e.target.value;
|
|
269
|
-
$update();
|
|
270
|
-
}
|
|
271
|
-
const alertLoginData = () => {
|
|
272
|
-
$zmp.dialog.alert('Username: ' + username + '<br/>Password: ' + password, () => {
|
|
273
|
-
$zmp.loginScreen.close();
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
return $render;
|
|
278
|
-
}
|
|
279
|
-
</script>
|
|
280
|
-
`);
|
|
281
|
-
}
|
|
282
|
-
return htmlTemplate;
|
|
283
|
-
};
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
const templateIf = require('../../utils/template-if');
|
|
2
|
-
const indent = require('../../utils/indent');
|
|
3
|
-
|
|
4
|
-
module.exports = (options) => {
|
|
5
|
-
const {
|
|
6
|
-
bundler, template,
|
|
7
|
-
} = options;
|
|
8
|
-
|
|
9
|
-
let routes;
|
|
10
|
-
if (template === 'blank') {
|
|
11
|
-
if (bundler === 'webpack') {
|
|
12
|
-
routes = indent(0, `
|
|
13
|
-
import HomePage from './pages/home.zmp.html';
|
|
14
|
-
|
|
15
|
-
var routes = [
|
|
16
|
-
{
|
|
17
|
-
path: '/',
|
|
18
|
-
component: HomePage,
|
|
19
|
-
},
|
|
20
|
-
];
|
|
21
|
-
`);
|
|
22
|
-
} else {
|
|
23
|
-
routes = indent(0, `
|
|
24
|
-
var routes = [
|
|
25
|
-
{
|
|
26
|
-
path: '/',
|
|
27
|
-
url: './index.html',
|
|
28
|
-
},
|
|
29
|
-
];
|
|
30
|
-
`);
|
|
31
|
-
}
|
|
32
|
-
} else if (bundler === 'webpack') {
|
|
33
|
-
routes = indent(0, `
|
|
34
|
-
import HomePage from './pages/home.zmp.html';
|
|
35
|
-
import AboutPage from './pages/about.zmp.html';
|
|
36
|
-
import FormPage from './pages/form.zmp.html';
|
|
37
|
-
${templateIf(template === 'tabs', () => `
|
|
38
|
-
import CatalogPage from './pages/catalog.zmp.html';
|
|
39
|
-
import ProductPage from './pages/product.zmp.html';
|
|
40
|
-
import SettingsPage from './pages/settings.zmp.html';
|
|
41
|
-
`)}
|
|
42
|
-
${templateIf(template === 'split-view', () => `
|
|
43
|
-
import LeftPage1 from './pages/left-page-1.zmp.html';
|
|
44
|
-
import LeftPage2 from './pages/left-page-2.zmp.html';
|
|
45
|
-
`)}
|
|
46
|
-
${templateIf(template !== 'blank', () => `
|
|
47
|
-
import DynamicRoutePage from './pages/dynamic-route.zmp.html';
|
|
48
|
-
import NotFoundPage from './pages/404.zmp.html';
|
|
49
|
-
`)}
|
|
50
|
-
|
|
51
|
-
var routes = [
|
|
52
|
-
{
|
|
53
|
-
path: '/',
|
|
54
|
-
component: HomePage,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
path: '/about/',
|
|
58
|
-
component: AboutPage,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
path: '/form/',
|
|
62
|
-
component: FormPage,
|
|
63
|
-
},
|
|
64
|
-
${templateIf(template === 'tabs', () => `
|
|
65
|
-
{
|
|
66
|
-
path: '/catalog/',
|
|
67
|
-
component: CatalogPage,
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
path: '/product/:id/',
|
|
71
|
-
component: ProductPage,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
path: '/settings/',
|
|
75
|
-
component: SettingsPage,
|
|
76
|
-
},
|
|
77
|
-
`)}
|
|
78
|
-
${templateIf(template === 'split-view', () => `
|
|
79
|
-
{
|
|
80
|
-
path: '/left-page-1/',
|
|
81
|
-
component: LeftPage1,
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
path: '/left-page-2/',
|
|
85
|
-
component: LeftPage2,
|
|
86
|
-
},
|
|
87
|
-
`)}
|
|
88
|
-
{
|
|
89
|
-
path: '/dynamic-route/blog/:blogId/post/:postId/',
|
|
90
|
-
component: DynamicRoutePage,
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
path: '(.*)',
|
|
94
|
-
component: NotFoundPage,
|
|
95
|
-
},
|
|
96
|
-
];
|
|
97
|
-
`);
|
|
98
|
-
} else {
|
|
99
|
-
routes = indent(0, `
|
|
100
|
-
var routes = [
|
|
101
|
-
{
|
|
102
|
-
path: '/',
|
|
103
|
-
url: './index.html',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
path: '/about/',
|
|
107
|
-
url: './pages/about.html',
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
path: '/form/',
|
|
111
|
-
url: './pages/form.html',
|
|
112
|
-
},
|
|
113
|
-
${templateIf(template === 'tabs', () => `
|
|
114
|
-
{
|
|
115
|
-
path: '/catalog/',
|
|
116
|
-
componentUrl: './pages/catalog.html',
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
path: '/product/:id/',
|
|
120
|
-
componentUrl: './pages/product.html',
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
path: '/settings/',
|
|
124
|
-
url: './pages/settings.html',
|
|
125
|
-
},
|
|
126
|
-
`)}
|
|
127
|
-
${templateIf(template === 'split-view', () => `
|
|
128
|
-
{
|
|
129
|
-
path: '/left-page-1/',
|
|
130
|
-
url: './pages/left-page-1.html',
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
path: '/left-page-2/',
|
|
134
|
-
url: './pages/left-page-2.html',
|
|
135
|
-
},
|
|
136
|
-
`)}
|
|
137
|
-
{
|
|
138
|
-
path: '/dynamic-route/blog/:blogId/post/:postId/',
|
|
139
|
-
componentUrl: './pages/dynamic-route.html',
|
|
140
|
-
},
|
|
141
|
-
// Default route (404 page). MUST BE THE LAST
|
|
142
|
-
{
|
|
143
|
-
path: '(.*)',
|
|
144
|
-
url: './pages/404.html',
|
|
145
|
-
},
|
|
146
|
-
];
|
|
147
|
-
`);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (bundler) {
|
|
151
|
-
routes += '\nexport default routes;';
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return routes;
|
|
155
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
const templateIf = require('../../utils/template-if');
|
|
2
|
-
const indent = require('../../utils/indent');
|
|
3
|
-
const appParameters = require('../app-parameters');
|
|
4
|
-
const stylesExtension = require('../../utils/styles-extension');
|
|
5
|
-
|
|
6
|
-
module.exports = (options) => {
|
|
7
|
-
const {
|
|
8
|
-
bundler,
|
|
9
|
-
type,
|
|
10
|
-
cssPreProcessor,
|
|
11
|
-
theming,
|
|
12
|
-
customBuild,
|
|
13
|
-
template,
|
|
14
|
-
} = options;
|
|
15
|
-
|
|
16
|
-
let scripts = '';
|
|
17
|
-
|
|
18
|
-
if (bundler) {
|
|
19
|
-
scripts += indent(
|
|
20
|
-
0,
|
|
21
|
-
`
|
|
22
|
-
import $ from 'zmp-dom';
|
|
23
|
-
${templateIf(
|
|
24
|
-
customBuild,
|
|
25
|
-
() => `
|
|
26
|
-
import ZMP from './zmp-custom.js';
|
|
27
|
-
`,
|
|
28
|
-
() => `
|
|
29
|
-
import ZMP from 'zmp-framework/core/bundle';
|
|
30
|
-
`
|
|
31
|
-
)}
|
|
32
|
-
|
|
33
|
-
// Import ZMP Styles
|
|
34
|
-
${templateIf(
|
|
35
|
-
customBuild,
|
|
36
|
-
() => `
|
|
37
|
-
import '../css/zmp-custom.less';
|
|
38
|
-
`,
|
|
39
|
-
() => `
|
|
40
|
-
import 'zmp-framework/zmp-bundle.min.css';
|
|
41
|
-
`
|
|
42
|
-
)}
|
|
43
|
-
|
|
44
|
-
// Import Icons and App Custom Styles
|
|
45
|
-
${templateIf(
|
|
46
|
-
theming.iconFonts,
|
|
47
|
-
() => `
|
|
48
|
-
import '../css/icons.css';
|
|
49
|
-
`
|
|
50
|
-
)}
|
|
51
|
-
import '../css/app.${stylesExtension(cssPreProcessor)}';
|
|
52
|
-
// Import Store
|
|
53
|
-
import store from '../store.js';
|
|
54
|
-
|
|
55
|
-
// Import main app component
|
|
56
|
-
import App from '../app.zmp.html';
|
|
57
|
-
`
|
|
58
|
-
);
|
|
59
|
-
} else {
|
|
60
|
-
scripts += indent(
|
|
61
|
-
0,
|
|
62
|
-
`
|
|
63
|
-
var $ = Dom7;
|
|
64
|
-
`
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
scripts += indent(
|
|
69
|
-
0,
|
|
70
|
-
`
|
|
71
|
-
var app = new ZMP({
|
|
72
|
-
${indent(6, appParameters(options)).trim()}
|
|
73
|
-
});
|
|
74
|
-
${templateIf(
|
|
75
|
-
!bundler && template !== 'blank',
|
|
76
|
-
() => `
|
|
77
|
-
// Login Screen Demo
|
|
78
|
-
$('#my-login-screen .login-button').on('click', function () {
|
|
79
|
-
var username = $('#my-login-screen [name="username"]').val();
|
|
80
|
-
var password = $('#my-login-screen [name="password"]').val();
|
|
81
|
-
|
|
82
|
-
// Close login screen
|
|
83
|
-
app.loginScreen.close('#my-login-screen');
|
|
84
|
-
|
|
85
|
-
// Alert username and password
|
|
86
|
-
app.dialog.alert('Username: ' + username + '<br/>Password: ' + password);
|
|
87
|
-
});
|
|
88
|
-
`
|
|
89
|
-
)}
|
|
90
|
-
`
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
return scripts.trim();
|
|
94
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<div class="page">
|
|
2
|
-
<div class="navbar">
|
|
3
|
-
<div class="navbar-bg"></div>
|
|
4
|
-
<div class="navbar-inner sliding">
|
|
5
|
-
<div class="left">
|
|
6
|
-
<a href="#" class="link back">
|
|
7
|
-
<i class="icon icon-back"></i>
|
|
8
|
-
<span class="if-not-md">Back</span>
|
|
9
|
-
</a>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="title">Not found</div>
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
<div class="page-content">
|
|
15
|
-
<div class="block block-strong">
|
|
16
|
-
<p>Sorry</p>
|
|
17
|
-
<p>Requested content not found.</p>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|