zmp-cli 3.15.5 → 3.15.6-beta.1
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 +1 -0
- package/build/index.js +1 -184
- package/config/index.js +1 -44
- package/create/index.js +1 -230
- package/create/init-zmp-ui.js +1 -216
- package/create/templates/app-parameters.js +9 -25
- package/create/templates/common/webpack/build.js +2 -40
- package/create/templates/copy-assets.js +1 -158
- package/create/templates/core/copy-assets.js +14 -82
- package/create/templates/core/generate-home-page.js +16 -38
- package/create/templates/core/generate-root.js +28 -63
- package/create/templates/core/generate-routes.js +12 -38
- package/create/templates/core/generate-scripts.js +16 -65
- package/create/templates/create-folders.js +1 -30
- package/create/templates/generate-config-xml.js +2 -9
- package/create/templates/generate-index.js +10 -35
- package/create/templates/generate-manifest.js +1 -49
- package/create/templates/generate-recoil.js +4 -16
- package/create/templates/generate-routes.js +1 -16
- package/create/templates/generate-scripts.js +1 -16
- package/create/templates/generate-service-worker.js +4 -10
- package/create/templates/generate-store.js +4 -15
- package/create/templates/generate-styles.js +10 -64
- package/create/templates/generate-webpack-config.js +43 -125
- package/create/templates/generate-zmp-custom.js +14 -72
- package/create/templates/react/copy-assets.js +1 -85
- package/create/templates/react/generate-home-page.js +20 -50
- package/create/templates/react/generate-root.js +15 -44
- package/create/templates/react/generate-routes.js +1 -16
- package/create/templates/react/generate-scripts.js +12 -38
- package/create/templates/react/pages/404.js +2 -10
- package/create/templates/react/pages/about.js +2 -10
- package/create/templates/react/pages/catalog.js +3 -17
- package/create/templates/react/pages/dynamic-route.js +2 -10
- package/create/templates/react/pages/form.js +6 -26
- package/create/templates/react/pages/index copy.js +1 -17
- package/create/templates/react/pages/index.js +1 -17
- package/create/templates/react/pages/settings.js +3 -17
- package/create/templates/react/pages/user.js +8 -27
- package/create/templates/react-typescript/components/app-items.js +2 -9
- package/create/templates/react-typescript/components/index.js +1 -9
- package/create/templates/react-typescript/components/navbar-back.js +2 -9
- package/create/templates/react-typescript/components/user-card.js +2 -9
- package/create/templates/react-typescript/copy-assets.js +1 -94
- package/create/templates/react-typescript/generate-home-page.js +20 -52
- package/create/templates/react-typescript/generate-root.js +14 -45
- package/create/templates/react-typescript/generate-routes.js +1 -12
- package/create/templates/react-typescript/generate-scripts.js +12 -37
- package/create/templates/react-typescript/pages/404.js +2 -10
- package/create/templates/react-typescript/pages/about.js +2 -10
- package/create/templates/react-typescript/pages/catalog.js +3 -17
- package/create/templates/react-typescript/pages/dynamic-route.js +2 -10
- package/create/templates/react-typescript/pages/form.js +6 -26
- package/create/templates/react-typescript/pages/index.js +1 -17
- package/create/templates/react-typescript/pages/settings.js +3 -17
- package/create/templates/react-typescript/pages/user.js +8 -27
- package/create/templates/svelte/copy-assets.js +1 -47
- package/create/templates/svelte/generate-home-page.js +20 -56
- package/create/templates/svelte/generate-root.js +22 -80
- package/create/templates/svelte/generate-routes.js +7 -22
- package/create/templates/svelte/generate-scripts.js +7 -23
- package/create/templates/vue/copy-assets.js +1 -67
- package/create/templates/vue/generate-home-page.js +2 -8
- package/create/templates/vue/generate-root.js +3 -13
- package/create/templates/vue/generate-routes.js +1 -7
- package/create/templates/vue/generate-scripts.js +9 -26
- package/create/templates/vue/global-components.d.js +1 -0
- package/create/templates/zaui/copy-assets.js +1 -90
- package/create/templates/zaui/generate-home-page.js +27 -53
- package/create/templates/zaui/generate-root.js +14 -34
- package/create/templates/zaui/generate-routes.js +1 -10
- package/create/templates/zaui/generate-scripts.js +6 -20
- package/create/templates/zaui/generate-user-card.js +3 -18
- package/create/templates/zaui/pages/about.js +3 -20
- package/create/templates/zaui/pages/form.js +3 -20
- package/create/templates/zaui/pages/index.js +1 -9
- package/create/templates/zaui/pages/user.js +3 -20
- package/create/utils/colors.js +1 -94
- package/create/utils/generate-app-config.js +1 -34
- package/create/utils/generate-gitignore.js +1 -43
- package/create/utils/generate-npm-scripts.js +1 -26
- package/create/utils/generate-package-json.js +1 -132
- package/create/utils/generate-readme.js +1 -28
- package/create/utils/get-options.js +1 -204
- package/create/utils/indent.js +1 -31
- package/create/utils/npm-scripts.js +1 -62
- package/create/utils/string.js +1 -13
- package/create/utils/styles-extension.js +1 -9
- package/create/utils/template-if.js +1 -9
- package/deploy/index.js +1 -148
- 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 +11 -39
- package/start/generate-hr-config.js +1 -59
- 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/templates/dist/generate-styles.dev.js +0 -46
- package/create/utils/dist/get-options.dev.js +0 -277
- package/deploy/dist/index.dev.js +0 -227
- package/dist/index.dev.js +0 -352
- package/jsconfig.json +0 -8
- package/login/dist/index.dev.js +0 -223
- 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/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
package/utils/spinner.js
CHANGED
|
@@ -1,25 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
const spinner = {
|
|
4
|
-
instance: null,
|
|
5
|
-
start(text) {
|
|
6
|
-
spinner.instance = ora({ color: 'green', text }).start();
|
|
7
|
-
},
|
|
8
|
-
done(text) {
|
|
9
|
-
if (spinner.instance) spinner.instance.succeed(text);
|
|
10
|
-
},
|
|
11
|
-
end(...args) {
|
|
12
|
-
spinner.done(...args);
|
|
13
|
-
},
|
|
14
|
-
fail(text) {
|
|
15
|
-
if (spinner.instance) spinner.instance.fail(text);
|
|
16
|
-
},
|
|
17
|
-
error(text) {
|
|
18
|
-
if (spinner.instance) spinner.instance.fail(text);
|
|
19
|
-
},
|
|
20
|
-
text(text) {
|
|
21
|
-
if (spinner.instance) spinner.instance.text = text;
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
module.exports = spinner;
|
|
1
|
+
'use strict';const _0x116b5b=_0x5c96;(function(_0x2eb063,_0xfef5df){const _0x67ab9b=_0x5c96,_0x171659=_0x2eb063();while(!![]){try{const _0x5ae6a2=-parseInt(_0x67ab9b(0x1e1))/0x1*(-parseInt(_0x67ab9b(0x1dd))/0x2)+parseInt(_0x67ab9b(0x1e2))/0x3+parseInt(_0x67ab9b(0x1e9))/0x4+-parseInt(_0x67ab9b(0x1df))/0x5+parseInt(_0x67ab9b(0x1e5))/0x6+parseInt(_0x67ab9b(0x1e6))/0x7+-parseInt(_0x67ab9b(0x1e7))/0x8;if(_0x5ae6a2===_0xfef5df)break;else _0x171659['push'](_0x171659['shift']());}catch(_0x5529f6){_0x171659['push'](_0x171659['shift']());}}}(_0x8054,0x6f68c));function _0x8054(){const _0x3cec38=['exports','163XfcWLG','999885TPvNpA','green','ora','1261998BQmIGc','1008434Aejalg','8364048WoUtQm','text','2637012tDTcve','done','instance','5744XggQZt','fail','1566205FxYTlp'];_0x8054=function(){return _0x3cec38;};return _0x8054();}const n=require(_0x116b5b(0x1e4)),e={'instance':null,'start'(_0xd46483){const _0x4b4272=_0x116b5b;e[_0x4b4272(0x1dc)]=n({'color':_0x4b4272(0x1e3),'text':_0xd46483})['start']();},'done'(_0x5e53bf){const _0x5d46e1=_0x116b5b;e[_0x5d46e1(0x1dc)]&&e['instance']['succeed'](_0x5e53bf);},'end'(..._0x451daf){const _0x210e14=_0x116b5b;e[_0x210e14(0x1ea)](..._0x451daf);},'fail'(_0x1cbc13){e['instance']&&e['instance']['fail'](_0x1cbc13);},'error'(_0x332a60){const _0x4a1e07=_0x116b5b;e['instance']&&e[_0x4a1e07(0x1dc)][_0x4a1e07(0x1de)](_0x332a60);},'text'(_0x347149){const _0x393467=_0x116b5b;e[_0x393467(0x1dc)]&&(e[_0x393467(0x1dc)][_0x393467(0x1e8)]=_0x347149);}};function _0x5c96(_0x12b8af,_0x4a0dba){const _0x805400=_0x8054();return _0x5c96=function(_0x5c9653,_0x70de85){_0x5c9653=_0x5c9653-0x1dc;let _0x252965=_0x805400[_0x5c9653];return _0x252965;},_0x5c96(_0x12b8af,_0x4a0dba);}module[_0x116b5b(0x1e0)]=e;
|
package/utils/tunnel.js
CHANGED
|
@@ -1,36 +1 @@
|
|
|
1
|
-
const localtunnel = require('
|
|
2
|
-
const { deviceModeSetup } = require('./constants');
|
|
3
|
-
|
|
4
|
-
const openedTunnels = {};
|
|
5
|
-
|
|
6
|
-
async function openTunnel(port, subdomain) {
|
|
7
|
-
const tunnel = await localtunnel({
|
|
8
|
-
port,
|
|
9
|
-
host: `https://${deviceModeSetup.TUNNEL_SERVER_HOST}`,
|
|
10
|
-
subdomain,
|
|
11
|
-
});
|
|
12
|
-
openedTunnels[tunnel.url] = tunnel;
|
|
13
|
-
return tunnel.url;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
async function closeTunnel(url) {
|
|
17
|
-
const tunnel = openedTunnels[url];
|
|
18
|
-
if (tunnel) {
|
|
19
|
-
tunnel.close();
|
|
20
|
-
return true;
|
|
21
|
-
}
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async function closeAllTunnels() {
|
|
26
|
-
const res = await Promise.all(
|
|
27
|
-
Object.keys(openedTunnels).map((key) => closeTunnel(key))
|
|
28
|
-
);
|
|
29
|
-
return res.reduce((total, status) => total + (status ? 1 : 0), 0);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
module.exports = {
|
|
33
|
-
openTunnel,
|
|
34
|
-
closeTunnel,
|
|
35
|
-
closeAllTunnels,
|
|
36
|
-
};
|
|
1
|
+
'use strict';const _0x5e0baf=_0x395a;function _0x43e7(){const _0x2f3a72=['173392kMxCPB','https://','reduce','url','880590EDFPze','30734724twkCFP','2038880tUBsPU','33981UGhcAp','171IQfMas','TUNNEL_SERVER_HOST','map','4416054augiCA','1157112ITryme','250lxvQhU','localtunnel','./constants','11pYFQdG','10eSuGMW','161nypyzL'];_0x43e7=function(){return _0x2f3a72;};return _0x43e7();}(function(_0xc0c07b,_0xffc0f9){const _0x11edfb=_0x395a,_0x2547fc=_0xc0c07b();while(!![]){try{const _0x4244a8=-parseInt(_0x11edfb(0x121))/0x1+parseInt(_0x11edfb(0x122))/0x2*(parseInt(_0x11edfb(0x12f))/0x3)+parseInt(_0x11edfb(0x12e))/0x4+parseInt(_0x11edfb(0x126))/0x5*(parseInt(_0x11edfb(0x133))/0x6)+parseInt(_0x11edfb(0x127))/0x7*(-parseInt(_0x11edfb(0x128))/0x8)+-parseInt(_0x11edfb(0x130))/0x9*(-parseInt(_0x11edfb(0x12c))/0xa)+parseInt(_0x11edfb(0x125))/0xb*(-parseInt(_0x11edfb(0x12d))/0xc);if(_0x4244a8===_0xffc0f9)break;else _0x2547fc['push'](_0x2547fc['shift']());}catch(_0xe33ce9){_0x2547fc['push'](_0x2547fc['shift']());}}}(_0x43e7,0xd0785));const t=require(_0x5e0baf(0x123)),{deviceModeSetup:e}=require(_0x5e0baf(0x124)),n={};async function r(_0x1d9011,_0x5edbdd){const _0xf21bac=_0x5e0baf;let _0x33a152=await t({'port':_0x1d9011,'host':_0xf21bac(0x129)+e[_0xf21bac(0x131)],'subdomain':_0x5edbdd});return n[_0x33a152['url']]=_0x33a152,_0x33a152[_0xf21bac(0x12b)];}async function s(_0x46e477){let _0x3b4dfd=n[_0x46e477];return!!_0x3b4dfd&&(_0x3b4dfd['close'](),!0x0);}function _0x395a(_0x569e53,_0x907b53){const _0x43e7f5=_0x43e7();return _0x395a=function(_0x395a08,_0x5584c8){_0x395a08=_0x395a08-0x121;let _0x162c5=_0x43e7f5[_0x395a08];return _0x162c5;},_0x395a(_0x569e53,_0x907b53);}async function u(){const _0x15e502=_0x5e0baf;return(await Promise['all'](Object['keys'](n)[_0x15e502(0x132)](_0x4debcb=>s(_0x4debcb))))[_0x15e502(0x12a)]((_0x3b10c2,_0x4cd11d)=>_0x3b10c2+(_0x4cd11d?0x1:0x0),0x0);}module['exports']={'openTunnel':r,'closeTunnel':s,'closeAllTunnels':u};
|
package/.editorconfig
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
.root = true
|
|
2
|
-
|
|
3
|
-
[*]
|
|
4
|
-
indent_style = space
|
|
5
|
-
indent_size = 2
|
|
6
|
-
quote_type = single
|
|
7
|
-
end_of_line = lf
|
|
8
|
-
charset = utf-8
|
|
9
|
-
trim_trailing_whitespace = true
|
|
10
|
-
insert_final_newline = true
|
|
11
|
-
|
|
12
|
-
# [*]
|
|
13
|
-
# end_of_line = lf
|
|
14
|
-
# charset = utf-8
|
|
15
|
-
# indent_style = space
|
package/.eslintignore
DELETED
package/.eslintrc.js
DELETED
package/.vscode/launch.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Use IntelliSense to learn about possible attributes.
|
|
3
|
-
// Hover to view descriptions of existing attributes.
|
|
4
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
-
"version": "0.2.0",
|
|
6
|
-
"configurations": [
|
|
7
|
-
{
|
|
8
|
-
"type": "pwa-node",
|
|
9
|
-
"request": "launch",
|
|
10
|
-
"name": "Launch Program",
|
|
11
|
-
"skipFiles": [
|
|
12
|
-
"<node_internals>/**"
|
|
13
|
-
],
|
|
14
|
-
"program": "${workspaceFolder}/index.js",
|
|
15
|
-
"args": [
|
|
16
|
-
"start",
|
|
17
|
-
"--device"
|
|
18
|
-
],
|
|
19
|
-
"cwd": "${workspaceFolder}/../zaui-coffee/",
|
|
20
|
-
"console": "integratedTerminal"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018 Vladimir Kharlampidi
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/README.git.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# ZMP-CLI
|
|
2
|
-
CLI dùng để start, build, deploy Zalo Mini App
|
|
3
|
-
|
|
4
|
-
## Contribute
|
|
5
|
-
Project bao gồm các nhánh:
|
|
6
|
-
- master: nhánh chính tương ứng với version đang release
|
|
7
|
-
- develop: nhánh chính, source code mới nhất bao gồm các tính năng chuẩn bị cho lần release tiếp theo
|
|
8
|
-
- feature/*: nhánh tương ứng với chức năng đang phát triển (xoá sau khi hoàn thành)
|
|
9
|
-
- release/*-rc: nhánh tương ứng với các release candidate (xoá sau khi hoàn thành)
|
|
10
|
-
- hotfix/*: nhánh tương ứng với bug cần fix cho version đang release (xoá sau khi hoàn thành)
|
|
11
|
-
|
|
12
|
-
Suggest sử dụng git flow để quản lí các nhánh:
|
|
13
|
-
1. Cài đặt và tìm hiểu git flow theo [hướng dẫn](https://danielkummer.github.io/git-flow-cheatsheet/index.vi_VN.html)
|
|
14
|
-
2. Init git flow tương ứng với các branch trên: ```git flow init```
|
|
15
|
-
|
|
16
|
-
Phát triển một tính năng mới:
|
|
17
|
-
1. Để bắt đầu code tính năng mới: ```git flow feature start feature_1```
|
|
18
|
-
2. Sau khi code và test xong: ```git flow feature finish feature_1```, tính năng sẽ được merge vào nhánh develop
|
|
19
|
-
|
|
20
|
-
Tạo một release candidate (suffix "-rc"):
|
|
21
|
-
1. ```git flow release start <major>.<minor>.<patch>-rc```
|
|
22
|
-
2. Sau khi test xong: ```git flow release finish <major>.<minor>.<patch>-rc```, tính năng sẽ được merge vào nhánh master để chờ release và nhánh develop
|
|
23
|
-
|
|
24
|
-
Để fix bug trên bản release:
|
|
25
|
-
1. ```git flow hotfix start bug-a```
|
|
26
|
-
2. Sau khi fix xong: ```git flow hotfix finish bug-a```, tính năng sẽ được merge vào nhánh master để chờ release và nhánh develop
|
|
27
|
-
|
|
28
|
-
Để fix bug trên bản release-candidate:
|
|
29
|
-
1. Tạo nhánh mới từ nhánh rc muốn fix với refix: ```git branch ```
|
|
30
|
-
2. Sau khi fix xong: ```git flow hotfix finish bug-a```, tính năng sẽ được merge vào nhánh master để chờ release và nhánh develop
|
|
31
|
-
|
|
32
|
-
Để release nhánh master:
|
|
33
|
-
1. ```npm run release```
|
|
34
|
-
2. Nhập version:
|
|
35
|
-
- patch: fix bug
|
|
36
|
-
- minor: thêm tính năng
|
|
37
|
-
- major: thay đổi lớn có ảnh hưởng tới version cũ
|
package/assets/index.js
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
// /* eslint no-param-reassign: off */
|
|
2
|
-
// const sharp = require('sharp');
|
|
3
|
-
// const path = require('path');
|
|
4
|
-
// const chalk = require('chalk');
|
|
5
|
-
// const fse = require('../utils/fs-extra');
|
|
6
|
-
|
|
7
|
-
// async function generateAssets(options, project, logger, { exitOnError = true } = {}) {
|
|
8
|
-
// if (!logger) {
|
|
9
|
-
// // eslint-disable-next-line
|
|
10
|
-
// logger = {
|
|
11
|
-
// statusStart() {},
|
|
12
|
-
// statusDone() {},
|
|
13
|
-
// statusError() {},
|
|
14
|
-
// text() {},
|
|
15
|
-
// error() {},
|
|
16
|
-
// };
|
|
17
|
-
// }
|
|
18
|
-
// logger.statusStart(`Generating assets ${chalk.gray('(Please wait, it can take a while)')}`);
|
|
19
|
-
// /*
|
|
20
|
-
// options = {
|
|
21
|
-
// favicon: { src, output },
|
|
22
|
-
// pwaIcon: { src, output },
|
|
23
|
-
// appleTouchIcon: { src, output }
|
|
24
|
-
// };
|
|
25
|
-
// */
|
|
26
|
-
// if (project) {
|
|
27
|
-
// const {
|
|
28
|
-
// type, bundler, cwd
|
|
29
|
-
// } = project;
|
|
30
|
-
// if (type.indexOf('web') >= 0 || type.indexOf('pwa') >= 0) {
|
|
31
|
-
// const assetsFolder = bundler === 'webpack' ? 'static' : 'assets';
|
|
32
|
-
// const srcFolder = bundler ? 'src' : 'www';
|
|
33
|
-
// options.favicon = {
|
|
34
|
-
// src: path.resolve(cwd, 'assets-src', 'web-icon.png'),
|
|
35
|
-
// output: path.resolve(cwd, srcFolder, assetsFolder, 'icons'),
|
|
36
|
-
// };
|
|
37
|
-
// options.pwaIcon = {
|
|
38
|
-
// src: path.resolve(cwd, 'assets-src', 'web-icon.png'),
|
|
39
|
-
// output: path.resolve(cwd, srcFolder, assetsFolder, 'icons'),
|
|
40
|
-
// };
|
|
41
|
-
// options.appleTouchIcon = {
|
|
42
|
-
// src: path.resolve(cwd, 'assets-src', 'apple-touch-icon.png'),
|
|
43
|
-
// output: path.resolve(cwd, srcFolder, assetsFolder, 'icons'),
|
|
44
|
-
// };
|
|
45
|
-
// }
|
|
46
|
-
// }
|
|
47
|
-
|
|
48
|
-
// const presets = {
|
|
49
|
-
// appleTouchIcon: {
|
|
50
|
-
// size: 256,
|
|
51
|
-
// fileName: 'apple-touch-icon.png',
|
|
52
|
-
// },
|
|
53
|
-
// favicon: {
|
|
54
|
-
// size: 128,
|
|
55
|
-
// fileName: 'favicon.png',
|
|
56
|
-
// },
|
|
57
|
-
// pwaIcon: {
|
|
58
|
-
// size: [
|
|
59
|
-
// 128,
|
|
60
|
-
// 144,
|
|
61
|
-
// 152,
|
|
62
|
-
// 192,
|
|
63
|
-
// 256,
|
|
64
|
-
// 512,
|
|
65
|
-
// ],
|
|
66
|
-
// fileName: '{{size}}x{{size}}.png',
|
|
67
|
-
// }
|
|
68
|
-
// };
|
|
69
|
-
|
|
70
|
-
// const promises = [];
|
|
71
|
-
|
|
72
|
-
// function resizeImage(src, output, size) {
|
|
73
|
-
// const outputPath = path.parse(output);
|
|
74
|
-
// if (!fse.existsSync(outputPath.dir)) {
|
|
75
|
-
// fse.mkdirSync(outputPath.dir);
|
|
76
|
-
// }
|
|
77
|
-
// promises.push(sharp(src).resize(size).toFile(output));
|
|
78
|
-
// }
|
|
79
|
-
|
|
80
|
-
// function handlePreset(preset, opts) {
|
|
81
|
-
// if (typeof preset.size === 'number') {
|
|
82
|
-
// resizeImage(
|
|
83
|
-
// opts.src,
|
|
84
|
-
// path.resolve(opts.output, preset.fileName),
|
|
85
|
-
// preset.size,
|
|
86
|
-
// );
|
|
87
|
-
// return;
|
|
88
|
-
// }
|
|
89
|
-
// if (Array.isArray(preset.size)) {
|
|
90
|
-
// preset.size.forEach((currentSize) => {
|
|
91
|
-
// resizeImage(
|
|
92
|
-
// opts.src,
|
|
93
|
-
// path.resolve(opts.output, preset.fileName.replace(/{{size}}/g, currentSize)),
|
|
94
|
-
// currentSize,
|
|
95
|
-
// );
|
|
96
|
-
// });
|
|
97
|
-
// return;
|
|
98
|
-
// }
|
|
99
|
-
// if (typeof preset.size === 'object') {
|
|
100
|
-
// Object.keys(preset.size).forEach((sizeKey) => {
|
|
101
|
-
// if (Number.isFinite(Number(sizeKey))) {
|
|
102
|
-
// const ratio = sizeKey;
|
|
103
|
-
// preset.size[ratio].forEach((currentSize) => {
|
|
104
|
-
// resizeImage(
|
|
105
|
-
// opts.src,
|
|
106
|
-
// path.resolve(opts.output, preset.fileName.replace(/{{ratio}}/g, ratio).replace(/{{size}}/g, currentSize)),
|
|
107
|
-
// currentSize * ratio,
|
|
108
|
-
// );
|
|
109
|
-
// });
|
|
110
|
-
// return;
|
|
111
|
-
// }
|
|
112
|
-
// if (typeof sizeKey === 'string') {
|
|
113
|
-
// const currentSize = preset.size[sizeKey];
|
|
114
|
-
// resizeImage(
|
|
115
|
-
// opts.src,
|
|
116
|
-
// path.resolve(opts.output, preset.fileName.replace(/{{key}}/g, sizeKey)),
|
|
117
|
-
// currentSize,
|
|
118
|
-
// );
|
|
119
|
-
// }
|
|
120
|
-
// });
|
|
121
|
-
// }
|
|
122
|
-
// }
|
|
123
|
-
|
|
124
|
-
// Object.keys(presets).forEach((key) => {
|
|
125
|
-
// if (!options[key]) return;
|
|
126
|
-
// const preset = presets[key];
|
|
127
|
-
// const opts = options[key];
|
|
128
|
-
// if (Array.isArray(preset)) {
|
|
129
|
-
// preset.forEach((p) => {
|
|
130
|
-
// handlePreset(p, opts);
|
|
131
|
-
// });
|
|
132
|
-
// return;
|
|
133
|
-
// }
|
|
134
|
-
// handlePreset(preset, opts);
|
|
135
|
-
// });
|
|
136
|
-
|
|
137
|
-
// try {
|
|
138
|
-
// await Promise.all(promises);
|
|
139
|
-
// } catch (err) {
|
|
140
|
-
// logger.statusError('Error generating assets');
|
|
141
|
-
// if (err) logger.error(err.stderr || err);
|
|
142
|
-
// if (exitOnError) process.exit(1);
|
|
143
|
-
// }
|
|
144
|
-
// logger.statusDone('Generating assets');
|
|
145
|
-
// }
|
|
146
|
-
|
|
147
|
-
// module.exports = generateAssets;
|
package/build/dist/index.dev.js
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/* eslint no-console: off */
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
7
|
-
|
|
8
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
9
|
-
|
|
10
|
-
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
11
|
-
|
|
12
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
13
|
-
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
|
-
|
|
18
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
-
|
|
20
|
-
var chalk = require('chalk');
|
|
21
|
-
|
|
22
|
-
var ora = require('ora');
|
|
23
|
-
|
|
24
|
-
var path = require('path');
|
|
25
|
-
|
|
26
|
-
var _require = require('vite'),
|
|
27
|
-
build = _require.build;
|
|
28
|
-
|
|
29
|
-
var dynamicImportVars = require('@rollup/plugin-dynamic-import-vars')["default"];
|
|
30
|
-
|
|
31
|
-
var _ = require('lodash');
|
|
32
|
-
|
|
33
|
-
var replace = require('@rollup/plugin-replace');
|
|
34
|
-
|
|
35
|
-
var log = require('../utils/log');
|
|
36
|
-
|
|
37
|
-
var fse = require('../utils/fs-extra');
|
|
38
|
-
|
|
39
|
-
var getAppInfo = require('../utils/get-app-info');
|
|
40
|
-
|
|
41
|
-
var envUtils = require('../utils/env');
|
|
42
|
-
|
|
43
|
-
var config = require('../config');
|
|
44
|
-
|
|
45
|
-
var generatePagesMap = require('../utils/generate-pages-map');
|
|
46
|
-
|
|
47
|
-
var env = envUtils.getEnv('NODE_ENV') || 'production';
|
|
48
|
-
var waitText = chalk.gray('Building... (Please wait, it can take a while)');
|
|
49
|
-
var frameworkWarning = chalk.yellow('Warning: This CLI version will work better with zmp-framework version 1.5.0 or higher');
|
|
50
|
-
var spinner = ora(env === 'production' ? 'Building for production...' : 'Building development version...');
|
|
51
|
-
|
|
52
|
-
module.exports = function _callee() {
|
|
53
|
-
var options,
|
|
54
|
-
logger,
|
|
55
|
-
_ref,
|
|
56
|
-
_ref$exitOnError,
|
|
57
|
-
exitOnError,
|
|
58
|
-
cwd,
|
|
59
|
-
resolvePath,
|
|
60
|
-
appConfig,
|
|
61
|
-
errorExit,
|
|
62
|
-
appId,
|
|
63
|
-
nextVersion,
|
|
64
|
-
appInfo,
|
|
65
|
-
currentVersion,
|
|
66
|
-
viteConfig,
|
|
67
|
-
isTypeScriptProject,
|
|
68
|
-
res,
|
|
69
|
-
output,
|
|
70
|
-
jsFiles,
|
|
71
|
-
cssFiles,
|
|
72
|
-
appConfigJson,
|
|
73
|
-
_args = arguments;
|
|
74
|
-
|
|
75
|
-
return regeneratorRuntime.async(function _callee$(_context) {
|
|
76
|
-
while (1) {
|
|
77
|
-
switch (_context.prev = _context.next) {
|
|
78
|
-
case 0:
|
|
79
|
-
errorExit = function _ref2(err) {
|
|
80
|
-
log.error(err.stderr || err);
|
|
81
|
-
if (exitOnError) process.exit(1);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
85
|
-
logger = _args.length > 1 ? _args[1] : undefined;
|
|
86
|
-
_ref = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}, _ref$exitOnError = _ref.exitOnError, exitOnError = _ref$exitOnError === void 0 ? true : _ref$exitOnError;
|
|
87
|
-
cwd = options.cwd || process.cwd();
|
|
88
|
-
|
|
89
|
-
resolvePath = function resolvePath(dir) {
|
|
90
|
-
return path.join(cwd, dir);
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
appConfig = options.appConfigJson || require(resolvePath(config.filename.appConfig));
|
|
94
|
-
|
|
95
|
-
if (!logger) {
|
|
96
|
-
// eslint-disable-next-line
|
|
97
|
-
logger = {
|
|
98
|
-
statusStart: function statusStart() {},
|
|
99
|
-
statusDone: function statusDone() {},
|
|
100
|
-
statusError: function statusError() {},
|
|
101
|
-
text: function text() {},
|
|
102
|
-
error: function error() {}
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
logger.text(frameworkWarning);
|
|
107
|
-
spinner.start();
|
|
108
|
-
logger.statusStart(waitText);
|
|
109
|
-
_context.prev = 11;
|
|
110
|
-
appId = envUtils.getEnv(config.env.appId);
|
|
111
|
-
nextVersion = options.nextVersion;
|
|
112
|
-
|
|
113
|
-
if (nextVersion) {
|
|
114
|
-
_context.next = 21;
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
_context.next = 17;
|
|
119
|
-
return regeneratorRuntime.awrap(getAppInfo(appId, options));
|
|
120
|
-
|
|
121
|
-
case 17:
|
|
122
|
-
appInfo = _context.sent;
|
|
123
|
-
currentVersion = appInfo && appInfo.latestVersion && Number(appInfo.latestVersion);
|
|
124
|
-
|
|
125
|
-
if (currentVersion === undefined || currentVersion === null) {
|
|
126
|
-
currentVersion = 0;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
nextVersion = currentVersion + 1;
|
|
130
|
-
|
|
131
|
-
case 21:
|
|
132
|
-
viteConfig = 'vite.config.js';
|
|
133
|
-
isTypeScriptProject = fse.existsSync(path.join(cwd, 'vite.config.ts'));
|
|
134
|
-
|
|
135
|
-
if (isTypeScriptProject) {
|
|
136
|
-
viteConfig = 'vite.config.ts';
|
|
137
|
-
} // eslint-disable-next-line
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
_context.next = 26;
|
|
141
|
-
return regeneratorRuntime.awrap(build({
|
|
142
|
-
configFile: path.join(cwd, viteConfig),
|
|
143
|
-
root: cwd,
|
|
144
|
-
base: "".concat(config.zdn_url).concat(appId, "/").concat(nextVersion, "/"),
|
|
145
|
-
css: {
|
|
146
|
-
modules: {
|
|
147
|
-
scopeBehaviour: 'local'
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
build: {
|
|
151
|
-
target: 'es2015',
|
|
152
|
-
outDir: path.join(cwd, 'www'),
|
|
153
|
-
assetsInlineLimit: 0,
|
|
154
|
-
cssCodeSplit: false,
|
|
155
|
-
cssTarget: ['es2015', 'safari13.1'],
|
|
156
|
-
rollupOptions: {
|
|
157
|
-
plugins: [replace({
|
|
158
|
-
values: {
|
|
159
|
-
ZMP_IMPORT_PAGES: function ZMP_IMPORT_PAGES() {
|
|
160
|
-
return generatePagesMap(cwd);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}), dynamicImportVars({
|
|
164
|
-
warnOnError: true
|
|
165
|
-
})],
|
|
166
|
-
output: {
|
|
167
|
-
entryFileNames: 'assets/[name].[hash].module.js',
|
|
168
|
-
chunkFileNames: 'assets/[name].[hash].module.js'
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
logLevel: 'error'
|
|
173
|
-
}));
|
|
174
|
-
|
|
175
|
-
case 26:
|
|
176
|
-
res = _context.sent;
|
|
177
|
-
output = res.output.map(function (obj) {
|
|
178
|
-
return _.pick(obj, ['fileName', 'type', 'isEntry', 'isImplicitEntry', 'isDynamicEntry']);
|
|
179
|
-
});
|
|
180
|
-
jsFiles = output.filter(function (file) {
|
|
181
|
-
if (file.type !== 'chunk') return false;
|
|
182
|
-
return file.isEntry || !file.isDynamicEntry;
|
|
183
|
-
});
|
|
184
|
-
cssFiles = output.filter(function (file) {
|
|
185
|
-
if (file.type !== 'asset' || !file.fileName.endsWith('.css')) return false; // const name = file.fileName.replace(/\.([a-z0-9]{8})\.css$/, '');
|
|
186
|
-
// if (!jsFiles.find((js) => js.fileName.startsWith(name))) return false;
|
|
187
|
-
|
|
188
|
-
return true;
|
|
189
|
-
});
|
|
190
|
-
appConfigJson = _objectSpread({}, appConfig, {
|
|
191
|
-
listCSS: [].concat(_toConsumableArray(Array.isArray(appConfig.listCSS) ? appConfig.listCSS : []), _toConsumableArray(cssFiles.map(function (f) {
|
|
192
|
-
return f.fileName;
|
|
193
|
-
}))),
|
|
194
|
-
listSyncJS: [].concat(_toConsumableArray(Array.isArray(appConfig.listSyncJS) ? appConfig.listSyncJS : []), _toConsumableArray(jsFiles.map(function (f) {
|
|
195
|
-
return f.fileName;
|
|
196
|
-
}))),
|
|
197
|
-
listAsyncJS: _toConsumableArray(Array.isArray(appConfig.listAsyncJS) ? appConfig.listAsyncJS : [])
|
|
198
|
-
});
|
|
199
|
-
fse.writeFileSync(resolvePath("www/".concat(config.filename.appConfig)), JSON.stringify(appConfigJson));
|
|
200
|
-
logger.statusDone("".concat(chalk.bold.green('Build Done!\n')));
|
|
201
|
-
return _context.abrupt("return", appConfigJson);
|
|
202
|
-
|
|
203
|
-
case 36:
|
|
204
|
-
_context.prev = 36;
|
|
205
|
-
_context.t0 = _context["catch"](11);
|
|
206
|
-
logger.statusError('Error building project'); // if (err) logger.error(err.stderr || err);
|
|
207
|
-
|
|
208
|
-
errorExit(_context.t0);
|
|
209
|
-
return _context.abrupt("return");
|
|
210
|
-
|
|
211
|
-
case 41:
|
|
212
|
-
case "end":
|
|
213
|
-
return _context.stop();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}, null, null, [[11, 36]]);
|
|
217
|
-
};
|
package/config/dist/index.dev.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
filename: {
|
|
5
|
-
appConfig: 'app-config.json',
|
|
6
|
-
zmpConfig: 'zmp-cli.json',
|
|
7
|
-
packageJson: 'package.json'
|
|
8
|
-
},
|
|
9
|
-
api_domain: 'https://zmp-api.developers.zalo.me/',
|
|
10
|
-
zdn_url: '//h5.zdn.vn/zapps/',
|
|
11
|
-
path: {
|
|
12
|
-
login: 'admin/login',
|
|
13
|
-
requestLogin: 'admin/request-login',
|
|
14
|
-
checkLoginStatus: 'admin/get-login-status',
|
|
15
|
-
// uploadApp: 'admin/upload-app',
|
|
16
|
-
uploadAppByChunk: 'app/upload-chunk',
|
|
17
|
-
requestUploadResumable: 'app/request-upload',
|
|
18
|
-
getAppInfo: 'app/get-info'
|
|
19
|
-
},
|
|
20
|
-
dirname: __dirname,
|
|
21
|
-
root_env: function root_env() {
|
|
22
|
-
return "".concat(process.cwd(), "/.env");
|
|
23
|
-
},
|
|
24
|
-
env: {
|
|
25
|
-
appId: 'APP_ID',
|
|
26
|
-
token: 'ZMP_TOKEN',
|
|
27
|
-
accessToken: 'VITE_ACCESS_TOKEN'
|
|
28
|
-
},
|
|
29
|
-
error_code: {
|
|
30
|
-
app_config_not_found: -1400,
|
|
31
|
-
permission_denied: -2001,
|
|
32
|
-
request_timeout: -2003
|
|
33
|
-
},
|
|
34
|
-
error_msg: {
|
|
35
|
-
app_config_not_found: "App config not found. Please re-init project. (Tips: Run 'zmp init')",
|
|
36
|
-
permission_denied: "Permission denied. Please login again. (Tips: Run 'zmp login')",
|
|
37
|
-
request_timeout: 'Request Timeout'
|
|
38
|
-
},
|
|
39
|
-
resumable_option: {
|
|
40
|
-
chunkSize: 512 * 1000,
|
|
41
|
-
// bytes -> 512kb/chunk
|
|
42
|
-
simultaneousUploads: 4,
|
|
43
|
-
testChunks: true,
|
|
44
|
-
throttleProgressCallbacks: 1,
|
|
45
|
-
method: 'octet',
|
|
46
|
-
forceChunkSize: false
|
|
47
|
-
}
|
|
48
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var indent = require('../utils/indent');
|
|
4
|
-
|
|
5
|
-
var _require = require('../utils/colors'),
|
|
6
|
-
colorThemeCSSProperties = _require.colorThemeCSSProperties;
|
|
7
|
-
|
|
8
|
-
module.exports = function (options) {
|
|
9
|
-
var template = options.template,
|
|
10
|
-
theming = options.theming;
|
|
11
|
-
var customColor = theming.customColor,
|
|
12
|
-
color = theming.color,
|
|
13
|
-
fillBars = theming.fillBars;
|
|
14
|
-
var styles = '';
|
|
15
|
-
var themeRgb = [0, 122, 255];
|
|
16
|
-
|
|
17
|
-
if (customColor && color) {
|
|
18
|
-
var customProps = colorThemeCSSProperties("".concat(color));
|
|
19
|
-
themeRgb = customProps['--zmp-theme-color-rgb'].split(',').map(function (n) {
|
|
20
|
-
return n.trim();
|
|
21
|
-
});
|
|
22
|
-
styles += indent(0, "\n /* Custom color theme properties */\n :root {\n ".concat(Object.keys(customProps).filter(function (prop) {
|
|
23
|
-
return prop !== '--zmp-tabbar-fill-link-active-color' && prop !== '--zmp-tabbar-fill-link-active-border-color';
|
|
24
|
-
}).map(function (prop) {
|
|
25
|
-
return "".concat(prop, ": ").concat(customProps[prop], ";");
|
|
26
|
-
}).join('\n '), "\n }\n :root.theme-dark,:root .theme-dark {\n ").concat(Object.keys(customProps).map(function (prop) {
|
|
27
|
-
return "".concat(prop, ": ").concat(customProps[prop], ";");
|
|
28
|
-
}).join('\n '), "\n }\n "));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (fillBars) {
|
|
32
|
-
styles += indent(0, "\n /* Invert navigation bars to fill style */\n ");
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (includeTailwind) {
|
|
36
|
-
styles += indent(0, "\n @import \"./tailwind.css\";\n ");
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (template === 'split-view') {
|
|
40
|
-
styles += indent(0, "\n /* Left Panel right border when it is visible by breakpoint */\n .panel-left.panel-in-breakpoint:before {\n position: absolute;\n right: 0;\n top: 0;\n height: 100%;\n width: 1px;\n background: rgba(0,0,0,0.1);\n content: '';\n z-index: 6000;\n }\n\n /* Hide navbar link which opens left panel when it is visible by breakpoint */\n .panel-left.panel-in-breakpoint ~ .view .navbar .panel-open[data-panel=\"left\"] {\n display: none;\n }\n\n /*\n Extra borders for main view and left panel for iOS theme when it behaves as panel (before breakpoint size)\n */\n .ios .panel-left:not(.panel-in-breakpoint).panel-in ~ .view-main:before,\n .ios .panel-left:not(.panel-in-breakpoint).panel-closing ~ .view-main:before {\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n width: 1px;\n background: rgba(0,0,0,0.1);\n content: '';\n z-index: 6000;\n }\n ");
|
|
41
|
-
} else {
|
|
42
|
-
styles += indent(0, "\n /* Your app custom styles here */\n ");
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return styles.trim();
|
|
46
|
-
};
|