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.
Files changed (225) hide show
  1. package/README.md +37 -0
  2. package/build/index.js +1 -184
  3. package/config/index.js +1 -44
  4. package/create/index.js +1 -230
  5. package/create/utils/generate-app-config.js +1 -34
  6. package/create/utils/generate-npm-scripts.js +1 -26
  7. package/create/utils/get-options.js +1 -204
  8. package/create/utils/npm-scripts.js +1 -62
  9. package/deploy/index.js +1 -149
  10. package/deploy/utils/get-options.js +1 -69
  11. package/deploy/utils/request-upload.js +1 -34
  12. package/deploy/utils/upload-app.js +1 -82
  13. package/index.js +1 -319
  14. package/login/index.js +1 -169
  15. package/login/utils/get-options.js +1 -58
  16. package/login/utils/zalo-login.js +1 -32
  17. package/migrate/icons/update-icon-v3.js +1 -19
  18. package/migrate/index.js +1 -60
  19. package/migrate/utils/get-options.js +1 -46
  20. package/migrate/utils/migrate-react.js +1 -33
  21. package/package.json +13 -40
  22. package/start/frame/index.html +264 -254
  23. package/start/index.js +1 -382
  24. package/sync/index-to-app-config.js +1 -146
  25. package/sync/index.js +1 -55
  26. package/utils/axios.js +1 -15
  27. package/utils/check-update.js +1 -53
  28. package/utils/constants.js +1 -20
  29. package/utils/env.js +1 -39
  30. package/utils/error.js +1 -16
  31. package/utils/find-files-by-ext.js +1 -27
  32. package/utils/find-free-port.js +1 -11
  33. package/utils/fs-extra.js +1 -90
  34. package/utils/generate-pages-map.js +1 -17
  35. package/utils/get-app-info.js +1 -22
  36. package/utils/get-current-project.js +1 -25
  37. package/utils/get-ip.js +1 -19
  38. package/utils/log.js +1 -19
  39. package/utils/node-blob.js +1 -106
  40. package/utils/resumable.d.js +1 -0
  41. package/utils/resumable.js +1 -1204
  42. package/utils/spinner.js +1 -25
  43. package/utils/tunnel.js +1 -36
  44. package/.editorconfig +0 -15
  45. package/.eslintignore +0 -8
  46. package/.eslintrc.js +0 -10
  47. package/.vscode/launch.json +0 -23
  48. package/LICENSE +0 -21
  49. package/README.git.md +0 -37
  50. package/assets/index.js +0 -147
  51. package/build/dist/index.dev.js +0 -217
  52. package/config/dist/index.dev.js +0 -48
  53. package/create/init-zmp-ui.js +0 -216
  54. package/create/templates/app-parameters.js +0 -33
  55. package/create/templates/common/css/icons.css +0 -60
  56. package/create/templates/common/icons/512x512.png +0 -0
  57. package/create/templates/common/icons/apple-touch-icon.png +0 -0
  58. package/create/templates/common/icons/favicon.png +0 -0
  59. package/create/templates/common/postcss.config.js +0 -5
  60. package/create/templates/common/splash-2732x2732.png +0 -0
  61. package/create/templates/common/tailwind/postcss.config.js +0 -5
  62. package/create/templates/common/tailwind/tailwind.config.js +0 -9
  63. package/create/templates/common/tailwind/tailwind.css +0 -3
  64. package/create/templates/common/webpack/build.js +0 -41
  65. package/create/templates/copy-assets.js +0 -158
  66. package/create/templates/core/babel.config.js +0 -11
  67. package/create/templates/core/copy-assets.js +0 -83
  68. package/create/templates/core/generate-home-page.js +0 -143
  69. package/create/templates/core/generate-root.js +0 -283
  70. package/create/templates/core/generate-routes.js +0 -155
  71. package/create/templates/core/generate-scripts.js +0 -94
  72. package/create/templates/core/pages/404.html +0 -20
  73. package/create/templates/core/pages/about.html +0 -26
  74. package/create/templates/core/pages/catalog.html +0 -40
  75. package/create/templates/core/pages/dynamic-route.html +0 -115
  76. package/create/templates/core/pages/form.html +0 -258
  77. package/create/templates/core/pages/left-page-1.html +0 -24
  78. package/create/templates/core/pages/left-page-2.html +0 -23
  79. package/create/templates/core/pages/product.html +0 -36
  80. package/create/templates/core/pages/request-and-load.html +0 -35
  81. package/create/templates/core/pages/settings.html +0 -252
  82. package/create/templates/create-folders.js +0 -30
  83. package/create/templates/dist/generate-styles.dev.js +0 -46
  84. package/create/templates/generate-config-xml.js +0 -18
  85. package/create/templates/generate-index.js +0 -49
  86. package/create/templates/generate-manifest.js +0 -49
  87. package/create/templates/generate-recoil.js +0 -56
  88. package/create/templates/generate-routes.js +0 -16
  89. package/create/templates/generate-scripts.js +0 -16
  90. package/create/templates/generate-service-worker.js +0 -126
  91. package/create/templates/generate-store.js +0 -88
  92. package/create/templates/generate-styles.js +0 -110
  93. package/create/templates/generate-webpack-config.js +0 -335
  94. package/create/templates/generate-zmp-custom.js +0 -81
  95. package/create/templates/react/babel.config.js +0 -12
  96. package/create/templates/react/components/app-items.jsx +0 -44
  97. package/create/templates/react/components/navbar-back.jsx +0 -25
  98. package/create/templates/react/components/user-card.jsx +0 -18
  99. package/create/templates/react/copy-assets.js +0 -85
  100. package/create/templates/react/dist/generate-scripts.dev.js +0 -23
  101. package/create/templates/react/generate-home-page.js +0 -111
  102. package/create/templates/react/generate-root.js +0 -84
  103. package/create/templates/react/generate-routes.js +0 -16
  104. package/create/templates/react/generate-scripts.js +0 -68
  105. package/create/templates/react/pages/404.js +0 -27
  106. package/create/templates/react/pages/about.js +0 -52
  107. package/create/templates/react/pages/catalog.js +0 -112
  108. package/create/templates/react/pages/dynamic-route.js +0 -80
  109. package/create/templates/react/pages/form.js +0 -152
  110. package/create/templates/react/pages/index copy.js +0 -17
  111. package/create/templates/react/pages/index.js +0 -17
  112. package/create/templates/react/pages/settings.js +0 -76
  113. package/create/templates/react/pages/user.js +0 -56
  114. package/create/templates/react/vite.config.js +0 -11
  115. package/create/templates/react-typescript/_tsconfig.json +0 -33
  116. package/create/templates/react-typescript/components/app-items.js +0 -53
  117. package/create/templates/react-typescript/components/index.js +0 -9
  118. package/create/templates/react-typescript/components/navbar-back.js +0 -40
  119. package/create/templates/react-typescript/components/user-card.js +0 -32
  120. package/create/templates/react-typescript/copy-assets.js +0 -94
  121. package/create/templates/react-typescript/dist/generate-scripts.dev.js +0 -23
  122. package/create/templates/react-typescript/generate-home-page.js +0 -113
  123. package/create/templates/react-typescript/generate-root.js +0 -81
  124. package/create/templates/react-typescript/generate-routes.js +0 -12
  125. package/create/templates/react-typescript/generate-scripts.js +0 -67
  126. package/create/templates/react-typescript/pages/404.js +0 -27
  127. package/create/templates/react-typescript/pages/about.js +0 -52
  128. package/create/templates/react-typescript/pages/catalog.js +0 -112
  129. package/create/templates/react-typescript/pages/dynamic-route.js +0 -80
  130. package/create/templates/react-typescript/pages/form.js +0 -152
  131. package/create/templates/react-typescript/pages/index.js +0 -17
  132. package/create/templates/react-typescript/pages/settings.js +0 -76
  133. package/create/templates/react-typescript/pages/user.js +0 -56
  134. package/create/templates/react-typescript/vite.config.js +0 -21
  135. package/create/templates/svelte/babel.config.js +0 -10
  136. package/create/templates/svelte/copy-assets.js +0 -47
  137. package/create/templates/svelte/generate-home-page.js +0 -158
  138. package/create/templates/svelte/generate-root.js +0 -235
  139. package/create/templates/svelte/generate-routes.js +0 -91
  140. package/create/templates/svelte/generate-scripts.js +0 -47
  141. package/create/templates/svelte/pages/404.svelte +0 -10
  142. package/create/templates/svelte/pages/about.svelte +0 -16
  143. package/create/templates/svelte/pages/catalog.svelte +0 -31
  144. package/create/templates/svelte/pages/dynamic-route.svelte +0 -34
  145. package/create/templates/svelte/pages/form.svelte +0 -175
  146. package/create/templates/svelte/pages/left-page-1.svelte +0 -13
  147. package/create/templates/svelte/pages/left-page-2.svelte +0 -12
  148. package/create/templates/svelte/pages/product.svelte +0 -21
  149. package/create/templates/svelte/pages/request-and-load.svelte +0 -21
  150. package/create/templates/svelte/pages/settings.svelte +0 -175
  151. package/create/templates/vue/babel.config.js +0 -10
  152. package/create/templates/vue/components/header.vue +0 -28
  153. package/create/templates/vue/components/sun-and-moon.vue +0 -34
  154. package/create/templates/vue/copy-assets.js +0 -67
  155. package/create/templates/vue/generate-home-page.js +0 -56
  156. package/create/templates/vue/generate-root.js +0 -50
  157. package/create/templates/vue/generate-routes.js +0 -7
  158. package/create/templates/vue/generate-scripts.js +0 -63
  159. package/create/templates/vue/global-components.d.ts +0 -121
  160. package/create/templates/vue/icons/moon.svg +0 -3
  161. package/create/templates/vue/icons/sun.svg +0 -3
  162. package/create/templates/vue/pages/404.vue +0 -12
  163. package/create/templates/vue/pages/about.vue +0 -15
  164. package/create/templates/vue/pages/catalog.vue +0 -39
  165. package/create/templates/vue/pages/dynamic-route.vue +0 -34
  166. package/create/templates/vue/pages/form.vue +0 -162
  167. package/create/templates/vue/pages/left-page-1.vue +0 -14
  168. package/create/templates/vue/pages/left-page-2.vue +0 -11
  169. package/create/templates/vue/pages/product.vue +0 -31
  170. package/create/templates/vue/pages/request-and-load.vue +0 -25
  171. package/create/templates/vue/pages/settings.vue +0 -18
  172. package/create/templates/vue/vite.config.js +0 -11
  173. package/create/templates/zaui/_tsconfig.json +0 -33
  174. package/create/templates/zaui/babel.config.js +0 -12
  175. package/create/templates/zaui/components/user-card.jsx +0 -16
  176. package/create/templates/zaui/copy-assets.js +0 -90
  177. package/create/templates/zaui/generate-home-page.js +0 -117
  178. package/create/templates/zaui/generate-root.js +0 -53
  179. package/create/templates/zaui/generate-routes.js +0 -10
  180. package/create/templates/zaui/generate-scripts.js +0 -39
  181. package/create/templates/zaui/generate-user-card.js +0 -55
  182. package/create/templates/zaui/pages/about.js +0 -129
  183. package/create/templates/zaui/pages/form.js +0 -123
  184. package/create/templates/zaui/pages/index.js +0 -9
  185. package/create/templates/zaui/pages/user.js +0 -109
  186. package/create/templates/zaui/vite.config.js +0 -11
  187. package/create/utils/colors.js +0 -94
  188. package/create/utils/dist/get-options.dev.js +0 -277
  189. package/create/utils/generate-gitignore.js +0 -43
  190. package/create/utils/generate-package-json.js +0 -132
  191. package/create/utils/generate-readme.js +0 -28
  192. package/create/utils/indent.js +0 -31
  193. package/create/utils/string.js +0 -13
  194. package/create/utils/styles-extension.js +0 -9
  195. package/create/utils/template-if.js +0 -9
  196. package/deploy/dist/index.dev.js +0 -227
  197. package/deploy/utils/dist/request-upload.dev.js +0 -62
  198. package/deploy/utils/dist/upload-app.dev.js +0 -113
  199. package/dist/bundle.js +0 -1
  200. package/dist/index.dev.js +0 -352
  201. package/jsconfig.json +0 -8
  202. package/login/dist/index.dev.js +0 -223
  203. package/login/utils/dist/zalo-login.dev.js +0 -41
  204. package/screenshots/wellcome.jpg +0 -0
  205. package/show-qr-app/assets/css/style.css +0 -87
  206. package/show-qr-app/assets/js/qrcode.min.js +0 -1
  207. package/show-qr-app/index.html +0 -57
  208. package/show-qr-app/package.json +0 -14
  209. package/start/dist/index.dev.js +0 -312
  210. package/start/generate-hr-config.js +0 -59
  211. package/ui/server.js +0 -194
  212. package/ui/www/css/app.css +0 -1
  213. package/ui/www/css/app.css.map +0 -1
  214. package/ui/www/fonts/ZMPIcons-Regular.eot +0 -0
  215. package/ui/www/fonts/ZMPIcons-Regular.ttf +0 -0
  216. package/ui/www/fonts/ZMPIcons-Regular.woff +0 -0
  217. package/ui/www/fonts/ZMPIcons-Regular.woff2 +0 -0
  218. package/ui/www/images/logo.png +0 -0
  219. package/ui/www/index.html +0 -1
  220. package/ui/www/js/app.js +0 -3
  221. package/ui/www/js/app.js.LICENSE.txt +0 -20
  222. package/ui/www/js/app.js.map +0 -1
  223. package/ui/www/static/icons/apple-touch-icon.png +0 -0
  224. package/ui/www/static/icons/favicon.png +0 -0
  225. package/utils/dist/get-app-info.dev.js +0 -54
@@ -1,252 +0,0 @@
1
- <div class="page" data-name="settings">
2
- <div class="navbar">
3
- <div class="navbar-bg"></div>
4
- <div class="navbar-inner sliding">
5
- <div class="title">Settings</div>
6
- </div>
7
- </div>
8
- <div class="page-content">
9
- <div class="block-title">Form Example</div>
10
- <div class="list no-hairlines-md">
11
- <ul>
12
- <li>
13
- <div class="item-content item-input">
14
- <div class="item-inner">
15
- <div class="item-title item-label">Name</div>
16
- <div class="item-input-wrap">
17
- <input type="text" placeholder="Your name"/>
18
- </div>
19
- </div>
20
- </div>
21
- </li>
22
- <li>
23
- <div class="item-content item-input">
24
- <div class="item-inner">
25
- <div class="item-title item-label">E-mail</div>
26
- <div class="item-input-wrap">
27
- <input type="email" placeholder="E-mail"/>
28
- </div>
29
- </div>
30
- </div>
31
- </li>
32
- <li>
33
- <div class="item-content item-input">
34
- <div class="item-inner">
35
- <div class="item-title item-label">URL</div>
36
- <div class="item-input-wrap">
37
- <input type="url" placeholder="URL"/>
38
- </div>
39
- </div>
40
- </div>
41
- </li>
42
- <li>
43
- <div class="item-content item-input">
44
- <div class="item-inner">
45
- <div class="item-title item-label">Password</div>
46
- <div class="item-input-wrap">
47
- <input type="password" placeholder="Password"/>
48
- </div>
49
- </div>
50
- </div>
51
- </li>
52
- <li>
53
- <div class="item-content item-input">
54
- <div class="item-inner">
55
- <div class="item-title item-label">Phone</div>
56
- <div class="item-input-wrap">
57
- <input type="tel" placeholder="Phone"/>
58
- </div>
59
- </div>
60
- </div>
61
- </li>
62
- <li>
63
- <div class="item-content item-input">
64
- <div class="item-inner">
65
- <div class="item-title item-label">Gender</div>
66
- <div class="item-input-wrap">
67
- <select>
68
- <option>Male</option>
69
- <option>Female</option>
70
- </select>
71
- </div>
72
- </div>
73
- </div>
74
- </li>
75
- <li>
76
- <div class="item-content item-input">
77
- <div class="item-inner">
78
- <div class="item-title item-label">Birth date</div>
79
- <div class="item-input-wrap">
80
- <input type="date" placeholder="Birth day" value="2014-04-30"/>
81
- </div>
82
- </div>
83
- </div>
84
- </li>
85
- <li>
86
- <div class="item-content">
87
- <div class="item-inner">
88
- <div class="item-title">Toggle</div>
89
- <div class="item-after">
90
- <label class="toggle toggle-init">
91
- <input type="checkbox"/>
92
- <span class="toggle-icon"></span>
93
- </label>
94
- </div>
95
- </div>
96
- </div>
97
- </li>
98
- <li>
99
- <div class="item-content item-input">
100
- <div class="item-inner">
101
- <div class="item-title item-label">Slider</div>
102
- <div class="item-input-wrap">
103
- <div class="range-slider range-slider-init" data-label="true">
104
- <input type="range" value="50" min="0" max="100" step="1"/>
105
- </div>
106
- </div>
107
- </div>
108
- </div>
109
- </li>
110
- <li class="align-top">
111
- <div class="item-content item-input">
112
- <div class="item-inner">
113
- <div class="item-title item-label">Textarea</div>
114
- <div class="item-input-wrap">
115
- <textarea placeholder="Bio"></textarea>
116
- </div>
117
- </div>
118
- </div>
119
- </li>
120
- <li class="align-top">
121
- <div class="item-content item-input">
122
- <div class="item-inner">
123
- <div class="item-title item-label">Resizable</div>
124
- <div class="item-input-wrap">
125
- <textarea placeholder="Bio" class="resizable"></textarea>
126
- </div>
127
- </div>
128
- </div>
129
- </li>
130
- </ul>
131
- </div>
132
- <div class="block-title">Buttons</div>
133
- <div class="block block-strong">
134
- <p class="row">
135
- <a href="#" class="col button">Button</a>
136
- <a href="#" class="col button button-fill">Fill</a>
137
- </p>
138
- <p class="row">
139
- <a href="#" class="col button button-raised">Raised</a>
140
- <a href="#" class="col button button-raised button-fill">Raised Fill</a>
141
- </p>
142
- <p class="row">
143
- <a href="#" class="col button button-round">Round</a>
144
- <a href="#" class="col button button-round button-fill">Round Fill</a>
145
- </p>
146
- <p class="row">
147
- <a href="#" class="col button button-outline">Outline</a>
148
- <a href="#" class="col button button-round button-outline">Outline Round</a>
149
- </p>
150
- <p class="row">
151
- <a href="#" class="col button button-small button-outline">Small</a>
152
- <a href="#" class="col button button-small button-round button-outline">Small Round</a>
153
- </p>
154
- <p class="row">
155
- <a href="#" class="col button button-small button-fill">Small</a>
156
- <a href="#" class="col button button-small button-round button-fill">Small Round</a>
157
- </p>
158
- <p class="row">
159
- <a href="#" class="col button button-large button-raised">Large</a>
160
- <a href="#" class="col button button-large button-fill button-raised">Large Fill</a>
161
- </p>
162
-
163
- <p class="row">
164
- <a href="#" class="col button button-large button-fill button-raised color-red">Large Red</a>
165
- <a href="#" class="col button button-large button-fill button-raised color-green">Large Green</a>
166
- </p>
167
-
168
- </div>
169
- <div class="block-title">Checkbox group</div>
170
- <div class="list">
171
- <ul>
172
- <li>
173
- <label class="item-checkbox item-content">
174
- <input type="checkbox" name="checkbox" value="Books" checked="checked"/>
175
- <i class="icon icon-checkbox"></i>
176
- <div class="item-inner">
177
- <div class="item-title">Books</div>
178
- </div>
179
- </label>
180
- </li>
181
- <li>
182
- <label class="item-checkbox item-content">
183
- <input type="checkbox" name="checkbox" value="Movies"/>
184
- <i class="icon icon-checkbox"></i>
185
- <div class="item-inner">
186
- <div class="item-title">Movies</div>
187
- </div>
188
- </label>
189
- </li>
190
- <li>
191
- <label class="item-checkbox item-content">
192
- <input type="checkbox" name="checkbox" value="Food"/>
193
- <i class="icon icon-checkbox"></i>
194
- <div class="item-inner">
195
- <div class="item-title">Food</div>
196
- </div>
197
- </label>
198
- </li>
199
- <li>
200
- <label class="item-checkbox item-content">
201
- <input type="checkbox" name="checkbox" value="Drinks"/>
202
- <i class="icon icon-checkbox"></i>
203
- <div class="item-inner">
204
- <div class="item-title">Drinks</div>
205
- </div>
206
- </label>
207
- </li>
208
- </ul>
209
- </div>
210
- <div class="block-title">Radio buttons group</div>
211
- <div class="list">
212
- <ul>
213
- <li>
214
- <label class="item-radio item-content">
215
- <input type="radio" name="radio" value="Books" checked="checked"/>
216
- <i class="icon icon-radio"></i>
217
- <div class="item-inner">
218
- <div class="item-title">Books</div>
219
- </div>
220
- </label>
221
- </li>
222
- <li>
223
- <label class="item-radio item-content">
224
- <input type="radio" name="radio" value="Movies"/>
225
- <i class="icon icon-radio"></i>
226
- <div class="item-inner">
227
- <div class="item-title">Movies</div>
228
- </div>
229
- </label>
230
- </li>
231
- <li>
232
- <label class="item-radio item-content">
233
- <input type="radio" name="radio" value="Food"/>
234
- <i class="icon icon-radio"></i>
235
- <div class="item-inner">
236
- <div class="item-title">Food</div>
237
- </div>
238
- </label>
239
- </li>
240
- <li>
241
- <label class="item-radio item-content">
242
- <input type="radio" name="radio" value="Drinks"/>
243
- <i class="icon icon-radio"></i>
244
- <div class="item-inner">
245
- <div class="item-title">Drinks</div>
246
- </div>
247
- </label>
248
- </li>
249
- </ul>
250
- </div>
251
- </div>
252
- </div>
@@ -1,30 +0,0 @@
1
- const path = require('path');
2
- const fse = require('../../utils/fs-extra');
3
-
4
- module.exports = (options) => {
5
- const cwd = options.cwd || process.cwd();
6
- const { framework } = options;
7
-
8
- const srcFolder = 'src';
9
-
10
- const folders = [
11
- `./${srcFolder}`,
12
- `./${srcFolder}/static`,
13
- `./${srcFolder}/css`,
14
- `./${srcFolder}/pages`,
15
- `./public`,
16
- './assets-src',
17
- ];
18
- if (folders.indexOf('./www') < 0) {
19
- folders.push('./www');
20
- }
21
- if (framework !== 'core') {
22
- folders.push(...[`./${srcFolder}/components`]);
23
- }
24
-
25
- folders.push(`./${srcFolder}/static/icons`);
26
-
27
- folders.forEach((f) => {
28
- fse.mkdirSync(path.resolve(cwd, f));
29
- });
30
- };
@@ -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
- };
@@ -1,18 +0,0 @@
1
- const indent = require('../utils/indent');
2
-
3
- module.exports = () => {
4
- return indent(
5
- 4,
6
- `
7
- <allow-navigation href="*" />
8
- <preference name="DisallowOverscroll" value="true" />
9
- <preference name="BackupWebStorage" value="local" />
10
- <preference name="AutoHideSplashScreen" value="false" />
11
- <preference name="ShowSplashScreenSpinner" value="false" />
12
- <preference name="SplashScreenDelay" value="0" />
13
- <preference name="Suppresses3DTouchGesture" value="true" />
14
- <preference name="Allow3DTouchLinkPreview" value="false" />
15
- <preference name="AllowInlineMediaPlayback" value="true" />
16
- `
17
- );
18
- };
@@ -1,49 +0,0 @@
1
- /* eslint curly: off */
2
- const { projectFramework } = require('../../utils/constants');
3
- const generateCoreRoot = require('./core/generate-root.js');
4
-
5
- module.exports = (options) => {
6
- const { name, framework, theming } = options;
7
- const srcFolder = '/src/';
8
- const iconsAssetsFolder = 'static';
9
-
10
- const rootContent = framework === 'core' ? generateCoreRoot(options) : '';
11
- const scripts = `
12
- <!-- built script files will be auto injected -->
13
- ${
14
- framework === projectFramework.REACT || framework === projectFramework.VUE
15
- ? `<script type="module" src="${srcFolder}app.js"></script>`
16
- : ''
17
- }
18
- ${
19
- framework === projectFramework.REACT_TYPESCRIPT
20
- ? `<script type="module" src="${srcFolder}app.ts"></script>`
21
- : ''
22
- }
23
- `.trim();
24
-
25
- return `
26
- <!DOCTYPE html>
27
- <html>
28
- <head>
29
- <meta charset="utf-8">
30
- <meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content:">
31
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, viewport-fit=cover">
32
-
33
- <meta name="theme-color" content="${
34
- theming.customColor && theming.color ? `${theming.color}` : '#007aff'
35
- }">
36
- <meta name="format-detection" content="telephone=no">
37
- <meta name="msapplication-tap-highlight" content="no">
38
- <link rel="icon" href="${srcFolder}${iconsAssetsFolder}/icons/favicon.png">
39
- <title>${name}</title>
40
- </head>
41
- <body>
42
- <div id="app"${
43
- framework === 'core' && theming.darkTheme ? 'class="theme-dark"' : ''
44
- }>${rootContent}</div>
45
- ${scripts}
46
- </body>
47
- </html>
48
- `.trim();
49
- };
@@ -1,49 +0,0 @@
1
- module.exports = (options) => {
2
- const { name, theming } = options;
3
- const iconsFolder = 'static';
4
- const manifest = {
5
- name,
6
- short_name: name,
7
- description: name,
8
- lang: 'en-US',
9
- start_url: '/',
10
- display: 'standalone',
11
- background_color:
12
- theming.customColor && theming.color ? `${theming.color}` : '#EE350F',
13
- theme_color:
14
- theming.customColor && theming.color ? `${theming.color}` : '#EE350F',
15
- icons: [
16
- {
17
- src: `/${iconsFolder}/icons/128x128.png`,
18
- sizes: '128x128',
19
- type: 'image/png',
20
- },
21
- {
22
- src: `/${iconsFolder}/icons/144x144.png`,
23
- sizes: '144x144',
24
- type: 'image/png',
25
- },
26
- {
27
- src: `/${iconsFolder}/icons/152x152.png`,
28
- sizes: '152x152',
29
- type: 'image/png',
30
- },
31
- {
32
- src: `/${iconsFolder}/icons/192x192.png`,
33
- sizes: '192x192',
34
- type: 'image/png',
35
- },
36
- {
37
- src: `/${iconsFolder}/icons/256x256.png`,
38
- sizes: '256x256',
39
- type: 'image/png',
40
- },
41
- {
42
- src: `/${iconsFolder}/icons/512x512.png`,
43
- sizes: '512x512',
44
- type: 'image/png',
45
- },
46
- ],
47
- };
48
- return JSON.stringify(manifest, null, 2);
49
- };
@@ -1,56 +0,0 @@
1
- const indent = require('../utils/indent');
2
- const templateIf = require('../utils/template-if');
3
-
4
- module.exports = (options) => {
5
- const { framework, template } = options;
6
-
7
- const productState = `
8
-
9
- export const productsState = atom({
10
- key: "products",
11
- default: [
12
- {
13
- id: '1',
14
- title: 'Apple iPhone 8',
15
- description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nisi tempora similique reiciendis, error nesciunt vero, blanditiis pariatur dolor, minima sed sapiente rerum, dolorem corrupti hic modi praesentium unde saepe perspiciatis.'
16
- },
17
- {
18
- id: '2',
19
- title: 'Apple iPhone 8 Plus',
20
- description: 'Velit odit autem modi saepe ratione totam minus, aperiam, labore quia provident temporibus quasi est ut aliquid blanditiis beatae suscipit odio vel! Nostrum porro sunt sint eveniet maiores, dolorem itaque!'
21
- },
22
- {
23
- id: '3',
24
- title: 'Apple iPhone X',
25
- description: 'Expedita sequi perferendis quod illum pariatur aliquam, alias laboriosam! Vero blanditiis placeat, mollitia necessitatibus reprehenderit. Labore dolores amet quos, accusamus earum asperiores officiis assumenda optio architecto quia neque, quae eum.'
26
- },
27
- ]
28
- });`;
29
-
30
- if (framework === 'react-typescript') {
31
- return `
32
- import { atom } from "recoil";
33
- import { userInfo } from 'zmp-sdk';
34
-
35
- export const userState = atom<userInfo>({
36
- key: "user",
37
- default: {
38
- id: '12345678',
39
- name: 'Zalo',
40
- avatar: 'ZA',
41
- }
42
- })
43
- ${templateIf(template === 'tabs', () => productState)}`;
44
- }
45
- return `import { atom } from "recoil";
46
-
47
- export const userState = atom({
48
- key: "user",
49
- default: {
50
- id: '12345678',
51
- name: 'Zalo',
52
- avatar: 'ZA',
53
- }
54
- })
55
- ${templateIf(template === 'tabs', () => productState)}`;
56
- };
@@ -1,16 +0,0 @@
1
- // const generateCoreRoutes = require('./core/generate-routes');
2
- const generateVueRoutes = require('./vue/generate-routes');
3
- const generateReactRoutes = require('./react/generate-routes');
4
- const generateReactTsRoutes = require('./react-typescript/generate-routes');
5
- // const generateSvelteRoutes = require('./svelte/generate-routes');
6
-
7
- module.exports = (options) => {
8
- const { framework } = options;
9
- // if (framework === 'core') return generateCoreRoutes(options);
10
- if (framework === 'vue') return generateVueRoutes(options);
11
- if (framework === 'react') return generateReactRoutes(options);
12
- if (framework === 'react-typescript') return generateReactTsRoutes(options);
13
-
14
- // if (framework === 'svelte') return generateSvelteRoutes(options);
15
- return [];
16
- };
@@ -1,16 +0,0 @@
1
- const generateCoreScripts = require('./core/generate-scripts');
2
- const generateVueScripts = require('./vue/generate-scripts');
3
- const generateReactScripts = require('./react/generate-scripts');
4
- const generateSvelteScripts = require('./svelte/generate-scripts');
5
- const generateReactTsScripts = require('./react-typescript/generate-scripts');
6
- const generateZauiScripts = require('./zaui/generate-scripts');
7
- module.exports = (options) => {
8
- const { framework, package } = options;
9
- if (package === 'zmp-ui') return generateZauiScripts(options);
10
- if (framework === 'core') return generateCoreScripts(options);
11
- if (framework === 'vue') return generateVueScripts(options);
12
- if (framework === 'react') return generateReactScripts(options);
13
- if (framework === 'svelte') return generateSvelteScripts(options);
14
- if (framework === 'react-typescript') return generateReactTsScripts(options);
15
- return '';
16
- };
@@ -1,126 +0,0 @@
1
- const indent = require('../utils/indent');
2
- const templateIf = require('../utils/template-if');
3
-
4
- module.exports = (options) => {
5
- const { bundler, theming } = options;
6
- return indent(0, `
7
- // Import Workbox (https://developers.google.com/web/tools/workbox/)
8
- importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.0.0/workbox-sw.js');
9
-
10
- /*
11
- Precache Manifest
12
- Change revision as soon as file content changed
13
- */
14
- self.__WB_MANIFEST = [
15
- {
16
- revision: '1',
17
- url: 'zmp/zmp-bundle.min.css'
18
- },
19
- {
20
- revision: '1',
21
- url: 'zmp/zmp-bundle.min.js'
22
- },
23
- {
24
- revision: '1',
25
- url: 'css/app.css'
26
- },
27
- ${templateIf(theming.iconFonts, () => `
28
- {
29
- revision: '1',
30
- url: 'css/icons.css'
31
- },
32
- `)}
33
- {
34
- revision: '1',
35
- url: 'routes.js'
36
- },
37
- {
38
- revision: '1',
39
- url: 'store.js'
40
- },
41
- {
42
- revision: '1',
43
- url: 'app.js'
44
- },
45
- ${templateIf(theming.iconFonts, () => `
46
- // Fonts
47
- {
48
- revision: '1',
49
- url: 'fonts/ZMPIcons-Regular.woff2'
50
- },
51
- {
52
- revision: '1',
53
- url: 'fonts/ZMPIcons-Regular.woff'
54
- },
55
- {
56
- revision: '1',
57
- url: 'fonts/ZMPIcons-Regular.eot'
58
- },
59
- {
60
- revision: '1',
61
- url: 'fonts/ZMPIcons-Regular.ttf'
62
- },
63
- {
64
- revision: '1',
65
- url: 'fonts/MaterialIcons-Regular.woff2'
66
- },
67
- {
68
- revision: '1',
69
- url: 'fonts/MaterialIcons-Regular.woff'
70
- },
71
- {
72
- revision: '1',
73
- url: 'fonts/MaterialIcons-Regular.ttf'
74
- },
75
- {
76
- revision: '1',
77
- url: 'fonts/MaterialIcons-Regular.eot'
78
- },
79
- `)}
80
- // HTML
81
- {
82
- revision: '1',
83
- url: './index.html'
84
- },
85
- // Icons
86
- {
87
- revision: '1',
88
- url: 'assets/icons/128x128.png'
89
- },
90
- {
91
- revision: '1',
92
- url: 'assets/icons/144x144.png'
93
- },
94
- {
95
- revision: '1',
96
- url: 'assets/icons/152x152.png'
97
- },
98
- {
99
- revision: '1',
100
- url: 'assets/icons/192x192.png'
101
- },
102
- {
103
- revision: '1',
104
- url: 'assets/icons/256x256.png'
105
- },
106
- {
107
- revision: '1',
108
- url: 'assets/icons/512x512.png'
109
- },
110
- {
111
- revision: '1',
112
- url: 'assets/icons/favicon.png'
113
- },
114
- {
115
- revision: '1',
116
- url: 'assets/icons/apple-touch-icon.png'
117
- },
118
- ];
119
-
120
- /*
121
- Enable precaching
122
- It is better to comment next line during development
123
- */
124
- workbox.precaching.precacheAndRoute(self.__WB_MANIFEST || []);
125
- `).trim();
126
- };